Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I map key combinations (pressing buttons simultaneously, not sequentially) in vim?

How do I map key combinations(pressing buttons simultaneously, not sequentially) in vim? suppose I wanted to map the command :!python % <ENTER> to pressing the keys j and k together?

I tried :map j+k :!python % <ENTER>, :map j-k :!python % <ENTER> and :map <j-k> :!python % <ENTER> but this doesn't work.

Also, which button combinations would you recommend mapping? (please not F1, F2, ... no combination with ctrl or shift.)

like image 878
Bentley4 Avatar asked Feb 20 '23 08:02

Bentley4


1 Answers

If using scripts is acceptable for you, then there is arpeggio script which should suit your needs.

like image 104
bjauy Avatar answered Feb 25 '23 17:02

bjauy