tags:

views:

20

answers:

2

StackOverflow's WYSIWYG has the ability to quickly surround highlighted text through keyboard shortcuts.

For example, when I push Ctrl+B on some highlighted text, it would bold the text or surround it with two stars.

I am looking for a tool that will give me this function but with "custom-input". That is... instead of bolding the word, I could surround it with a <div> tag or... in my case, I need to localize my Wordpress Plug-in, thus __("Surrounded Text").

I am currently using Notepad++ but I can't find any way to create this function.

Can this be done in Notepad++? If it can not, I would like some suggestion for a IDE that can.

Thank you.

A: 

You can do this in VIM using the surround plugin

Nathan Fellman
+1  A: 

If you've never used an "optimized" text editor, Vim would be a sea change, but it does have a great surround.vim plugin.

Emphasize hello: ysiw<em>

<em>Hello</em> world!

Finally, let's try out visual mode. Press a capital V (for linewise visual mode) followed by S<p class="important">.

<p class="important">
<em>Hello</em>> world!
</p>


Alternatively, you could probably get a fair bit of the functionality for which you are looking with an AutoHotkey script, but at best I think you'd have to do the highlight-first thing like the StackOverflow WYSIWYG editor.

Still, this would probably allow you to keep using Notepad++.

Jay
AutoHotkey works very well. I think it is the same as "Autoit". The [syntax] + cut+paste + [/syntax] is instantaneous and does exactly what I want. Thanks. Maybe one day, I should stick to Vim.
Anraiki