Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: <leader>h mapping slow

Tags:

vim

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.

like image 276
bitstream Avatar asked Aug 17 '15 15:08

bitstream


1 Answers

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. E.g., 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.

like image 131
Micah Elliott Avatar answered Oct 02 '22 16:10

Micah Elliott