James Lin
James Lin

Reputation: 26558

Vim key mapping how to map <leader> + key press together?

Currently I have this mapping:

noremap <leader>[ gT

Everytime I need to press leader, keyup, then [ to go to previous tab, is it possible to map it similar to Ctrl ones like C-[ so I don't have to keyup <leader> for keep going previous tabs?

I tried <leader-[> and it didn't work

Upvotes: 5

Views: 428

Answers (1)

jgriego
jgriego

Reputation: 1266

Vanilla vim doesn't support mappings for simultaneous input. But, I found this script on the vim website.

http://www.vim.org/scripts/script.php?script_id=2425

It's called Arpeggio. Usage is exactly as you'd expect, so for your case:

:Arpeggio noremap <Leader>[ gT

It looks like there's some caveats w/r/t multiple mappings with the same keys; not familiar enough with the script to say much though. Reading through their documentation would be a good place to start.

Hope that helps!

Upvotes: 3

Related Questions