0

I want to use the vi mode in bash but I find the ESC key a little bit too far, as for vim. The ideal can be to keep a key pressed, like ALT or the caps lock, to stay in command mode and be in insert mode when it's released. Have the option on all my system can be awesome!

In vim, my leader key is Space but it's not possible in insert mode. I don't know if it can help but I'm using tmux and zsh.

Is there a solution?

Dougui
  • 211
  • 1
  • 5
  • 17

1 Answers1

3

Caps_Lock is the one key on the keyboard that has no place in the modern age; unless, of course, you are sitting in a basement somewhere, in your underwear, RAILING against the injustices of some perceived slight from an anonymous, and equally irate, stranger somewhere else in the half light of the Internet.

Remapping Caps_Lock to Escape is not only going to make your experience using Vi-mode in the shell more pleasurable, it will make a (granted, infinitesimally small) contribution to reducing the amount of rage, real or imagined, online.

You can do this in X by adding the following to your ~/.xinitrc:

setxkbmap -option caps:escape

and in the console with a custom keymap file.

Anthony Geoghegan
  • 12,605
  • 7
  • 59
  • 62
jasonwryan
  • 71,734
  • 34
  • 193
  • 226