Forethinker
Forethinker

Reputation: 3778

How can I make closetag.vim automatic?

Currently closetag.vim only works with Ctrl+_ Is there a way so that I can make this automatic whenever I type \< ?

Upvotes: 0

Views: 411

Answers (2)

Ingo Karkat
Ingo Karkat

Reputation: 172658

This should do it:

:imap <Leader><lt> <Esc><C-_>a

I hope you intended to trigger via \ <; just the second key would make it impossible to write any starting tag (unless you disable the mapping via <C-V>). Because closetag offers a normal mode mapping, you need to switch to normal mode first (and then re-enter insert mode).

Upvotes: 0

Forethinker
Forethinker

Reputation: 3778

I gave up on closetag.vim and opted for xmledit. In order to make it work with html files, I did the following

Upvotes: 1

Related Questions