Vim Tips Wiki
Advertisement

You will like this if you manually edit a lot of HTML. Suppose you have a some lines in your file like this:

here is a random website > 

http://blog.buildlackey.com
The Build Lackey Blog


What you would do is go down to the line that references the URL, position your cursor anywhere on that line and type F7. The content of your file will be converted to:

here is a random website > 

<a href="http://blog.buildlackey.com">The Build Lackey Blog</a>


The key mapping you need to put into your .vimrc is:


" remap F7 to "create an <a href='url'>content</a> where url sits below content"
map <F7> <ESC>0i<a href="<ESC>A"><ESC>JxA</a>


Have fun

- Chris
Advertisement