vimmacvimvim-pluginemmet

Change emmet's leader key in Vim


Is it possible to to change the way you expand emmet code into HTML?

The default is ctrl+y+, and thats about two too many keys for my liking.

In sublime I just enter the emmet code and hit tab and it expands it. Is there a way to have it do this vim?


Solution

  • :help emmet-customize explains how to customize Emmet's mappings. As a "noob", you owe it to yourself to get used to Vim's documentation.

    You could add the line below to ~/.vimr/after/ftplugin/html.vim:

    inoremap <buffer> <tab> <plug>(emmet-expand-abbr)
    

    However, Emmet has a lot of features accessible via a number of mappings all using the same "leader", <C-y> so I'm not sure it is a good idea to take the direction you want to take.