1omscg
Last Updated: February 25, 2016
·
825
· pek
5f751d3f08afa8971636a36a5db5ccdc

VIM : easy insert HTML tags

vim

Add this cryptic string to your .vimrc

imap <C-t> <></><Esc>5hdiwp3lpT>i

If you are in insert mode, keyboard shortcut Ctrl+t create pair tag from word before cursor.

Usage:

  • write tag name. ex.: strong
  • press Ctrl+t
  • pair tag is created, insert content
Say Thanks
Respond

2 Responses
Add your response

4671
20096c359879f04a7a9cbc4aaa6cfdbb

I complemented with `map <C-t> bea<C-t>'

over 1 year ago ·
4676
2aaae7041aca85da930bcaf14d6768d2

You could try zencoding (https://github.com/mattn/zencoding-vim) and take that to a whole new level. ;-)

over 1 year ago ·