NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Transitioning from Dreamweaver, looking for 'code snippet'


Joined: 29 Feb 2008
Posts: 9
Reply with quote
Hello,

Is there a feature in PhpEd that will let you define a shortcut key for a code snippet that will wrap around highlighted code? For instance, I like Dreamweavers feature where I can add <strong> around some code by highlighting it and pressing CTL+B. Is this possible in PhpEd?

Thanks!
Chirs
View user's profileFind all posts by stompeersSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
There are a number of tags for that purpose defined by default (hint: checkout Editor > Editor shortcuts in the settings and then scroll all the way down to the "HTML Tags" section).
Unfortunately you cannot define new ones (unless I haven't discovered that yet).

There is a Code Templates section in the settings (Under the Editor part as well), that can be + used for this as well with a bit of tampering. Unfortunately you cannot assign a specific shortcut to the snippet, you'll have to use a dropdown list.

Still interested? Okay.
Define the code that you want to insert, use | for the place where you want the selected text (| is actually the caret position after insert).
In your case that would be <strong>|</strong>
Then all you have to do is select the code you want wrapped, hit the shortcut for the Templates dropdown (Ctrl+J by default), scroll down to the template you want to insert and hit enter. Presto!
PS: Note the Language drop down in that dialog, you'll have to define the things you want again per file type.

Obviously it would be nice to be able to assign a shortcut to a specific code template, but that's not possible (yet?) afaik.
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
you can also do this via an integration script (see appropriate forum on this site). it's a bit overkilling for such a trivial thing like inserting tags but lets you assign a shortcut.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Transitioning from Dreamweaver, looking for 'code snippet'
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