Tuesday, 28 January 2014

Nagrestconf REST Tutorial with a bit of Vim.

I've just finished the REST tutorial, and the File System Layout pages, and learned a few things myself! I've been doing all the Web site editing using Vim (and please don't say "It shows!") and the greatest thing I found today was Insert mode key mapping. I tried a couple different tag completion plugins that didn't really do what I wanted but all I needed to do was add the following to my ~/.vimrc,

imap </ </<c-x><c-o><esc>

The previous line also takes you out of insert mode, which gets really annoying, so the following is what I'm using now, which feels much better:

imap </ </<c-x><c-o>

So now I still fully type the opening tag, but when I started typing the closing tag, '</', it completes the tag for me. The other benefit is that I can start typing the closing tag at various places to see if it closes a tag I forgot to close.

No comments:

Post a Comment