简体   繁体   中英

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?

也许您应该.vimrc添加到您的.vimrc

let g:user_emmet_expandabbr_key = '<Tab>'

: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", <Cy> so I'm not sure it is a good idea to take the direction you want to take.

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.

i'm using let g:user_emmet_leader_key='<Ae>'

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM