3
votes

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?

4

4 Answers

7
votes

Maybe you should add the line below to your .vimrc:

let g:user_emmet_expandabbr_key = '<Tab>'

4
votes

: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.

1
votes

I added to my configuration the following mapping

imap ,, <C-y>,

So for example, if I type div or any other emmet expression, then I just type ,, and it gets completed.

0
votes

i'm using let g:user_emmet_leader_key='<A-e>'

use some special key (<C-e>, <A-e>...) or vim will wait for a emmet-vim command every time you type , or \