简体   繁体   中英

Vim: <leader>h mapping slow

I am not very good with vimscript, but I am trying to do some custom mappings in Vim. What I want to do is map <leader>h to switch to the previous tab, but when I press <leader> followed by h , it's waiting for another key and doesn't switch quickly. Is there a way to see what mappings are there starting with the "h" key and unmapping them? Or maybe another, more elegant solution?

Thanks, H.

To see all your mappings, type :map . To see what mapping(s) apply to a given prefix, like your h situation, type :map <leader>h .

What's likely happening is that you have some other h -mappings that take multiple characters. Eg, if you also have map <leader>hx , then vim will pause for timeoutlen milliseconds (see :help tm and also ttm ) before trying to honor your shorter <leader>h , in case you're actually trying to type the longer one.

So you'll need to track down where your longer mapping are coming from and possibly remove them.

Thats Because You need to add enter key also :)

let mapleader = "z"
nnoremap <leader>n :tabe<Enter>

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