Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emmet VIM trigger key remap issue

Tags:

vim

map

emmet

I just installed Emmet VIM plugin which looks very interesting. The "trigger key combination" to activate the Emmet plugin functionality is not the best it could be. Therefore I am trying to remap it in my vimrc file. I have successfully done that to remap the Escape key as follows:

inoremap ;; <ESC>

This allows me to type the semi-colon character ";" in rapid succession to get out of the insert mode and get in the normal mode. However it does not work when I try to remap the Emmet trigger key which is , (to be read as Control key and "y" key, followed by the "," key). I have tried the following combinations:

inoremap hh <C-y> ,
inoremap hh <C-y>,
inoremap hh <C-y,>

As you can see above, I am trying to map "hh" key combination to the Emmet VIM's trigger keys.

Thanks in advance for your time.

Bharat

like image 267
Bharat Avatar asked Sep 15 '13 22:09

Bharat


2 Answers

inoremap means that if there is a mapping (such as to ,) it will not be followed via the key combination for the mapping. You probably want imap

imap hh <C-y>,
like image 114
Explosion Pills Avatar answered Sep 22 '22 15:09

Explosion Pills


I use that:

let g:user_emmet_leader_key=','

So ',,' triggers Emmet.

like image 41
klos Avatar answered Sep 22 '22 15:09

klos