I'm looking for a Mac program that will change the keyboard layout based on the program that is currently in use. I want it to re-map certain keys to new mappings, not change the whole keyboard layout. For example, when I'm in the finder, I have a normal Mac keyboard layout. When I'm in Vim, I want to remap the escape key to one that is more reachable. Ideally this would just happen when I'm in the program without having to choose a modified layout from the keyboards option in the menu bar. I have several programs that I'd like to be able to do this with.
-
Does VIM let you set up a custom mapping for the function performed by Escape in that app?– Tom GeweckeCommented May 2, 2019 at 15:34
-
Vim was an example. I have a couple of IDE's that need some minor tweaks to the layout to make life easier. So not only Vim but other programs as well. Kind of how window focus works in some versions of Linux was what I was imaging. You don't have to click to make the window active, just hover over it.– John GargettCommented May 8, 2019 at 13:05
2 Answers
For Vim case, you could use Option+[ key combination, which is essentially equal to Escape. This is the default behaviour. True, it is two-key combination, but with little practice, you won't need to move your hands off the keyboard.
For the other applications you could use Karabiner problably.
Personally, I would just remap the CAPS LOCK key to escape and be done with it.
https://stackoverflow.com/questions/127591/using-caps-lock-as-esc-in-mac-os-x