NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Easy snippets


Joined: 22 Nov 2005
Posts: 9
Reply with quote
In a blog I regulaly read, the author mentioned <an unamed IDE Razz> and one of its features.

Quote:

The "snippets" editor allows you to define "snippets" of text that are activated either via a hot key or via a keyword followed by a tab. It comes with hundreds of pre-defined snippets, many for PHP. Not only can you define snippets of text, you can also use its tagging system to allow you to tab through the result to change data.

For example:
You type: "array" then hit tab. It adds "$arrayName = array( 'var', );" to the document with 'arrayName' highlighted. You type in your desired variable name, hit tab and it moves to "var", change that and hit tab and it moves to the comma, allowing you to delete it or to add more elements to the array.


This would be great in PHPEd, if it doesn't already have something similar. It would be a great timesaver and make the already amazing editor even better!

EDIT: Got rid of the IDE's name, as it is kind of a competitor (although it's Mac only software). Also one of the comments about was "I type com, hit tab, and type in my comment. The top and bottom dash lines will automatically expand to fit the text I type. It's cool stuff." which again would be great as part of a snippets editor.
View user's profileFind all posts by LewisSend private message


Joined: 22 Nov 2005
Posts: 9
Reply with quote
EDIT: Looks like you've already got this feature! It's in the code templates bit.

Well, in that case, any chance you could make it so you can have mutliple places for the cursor to be? In the random_array example you have it in more than one place, but I'm not sure if you can toggle to the next one. Also, the | character is used in PHP, so wouldn't it be better to use something less common? Like a ¬ or even a string (%%CURSOR%%)
View user's profileFind all posts by LewisSend private message
Easy snippets
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic