Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

vim

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

like image 832
James Lin Avatar asked Oct 21 '22 10:10

James Lin


1 Answers

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!

like image 52
jgriego Avatar answered Oct 24 '22 02:10

jgriego