Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remap <C> (control) modifier key in vim?

I avoid the "control" key, AKA <C> in vim parlance, on my laptop; I hate where Apple put it. I would really like to remap all of the vim commands using control to instead use "command", but this does not seem possible on a Mac, despite what I have read. I have read that I should use <Leader> to set such mappings, but I want to avoid remapping every single <C> mapping that I can find or think of in my .vimrc, just to forget some and bloat my .vimrc.

I want to avoid xmodmap or solutions beyond the scope of .vimrc, as I want to maintain compatibility of my config files that I sync across systems.

What I really want to do is specify an alternate key (probably ,) as a modifier key equivalent to <C>.

like image 762
David Rivers Avatar asked Aug 01 '10 02:08

David Rivers


1 Answers

There is definitely no vim-only solution for this; vim simply does not have this capability. Map <CapsLock> to <Ctrl> in System Preferences -> Keyboard -> Modifier Keys..., take a few minutes to adjust, and repeat for every MacBook you ever lay hands on (even if it's not yours). The world will be a better place for it.

like image 167
Araxia Avatar answered Sep 28 '22 00:09

Araxia