简体   繁体   中英

How to map <leader><leader>f to a comma key in Vim?

I found I've been using easy motion a lot recently, I want to map <leader><leader> f to a key, say ;

so I add the following line to vimrc file

imap ; <leader><leader>f

but it doesn't work,

any idea?

Your :imap covers insert mode and would prevent you from inserting a ; character into the text. The easymotion plugin is triggered from normal mode ; therefore, you have to use :nmap :

nmap ; <leader><leader>f

Though the usual recommendation is to use :noremap (it makes the mapping immune to remapping and recursion), here, because you're mapping to (the plugin's) mapping, you need to use :nmap .

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