On OS X, I've changed Caps-Lock to CTRL in the Keyboard Modifier settings. It's great, but I'd like to use CTRLCTRL (a quick double-tap) to ESC in VIM (my pinky is resisting CTRL[). Possible?
Already using au CursorHoldI * stopinsert
and set ut=2000
to exit Insert Mode
after two seconds, but some plugins interfere (completion, most often).
Aside: Could this, if possible, create a conflict with Tmux?
You cannot map Ctrl by itself in Vim at all, let alone CtrlCtrl. It is strictly a modifier key.
As @echristopherson mentioned, Karabiner can do some serious remap wizardry…
Jumping off his suggestion, I found the Karabiner documentation and came up with:
<?xml version="1.0"?>
<root>
<item>
<name>Ctrl Freak</name>
<identifier>private.double_ctrl_to_escape</identifier>
<autogen>
__DoublePressModifier__
KeyCode::CONTROL_L, KeyCode::CONTROL_L,
KeyCode::ESCAPE
</autogen>
</item>
</root>
I have done some quick testing with it, but from first blush, seems to perform without issue on OSX, SUBLIME TEXT, and VIM (within a TMUX session).
Keep in mind:
This is a system wide solution though.
For me, that's a good thing. I use a 60% keyboard and need to make the most of my real estate.
For a VIM specific solution:
You will need to add that bit. The documentation can be found here.
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With