8

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>.

David Rivers
  • 2,896
  • 1
  • 31
  • 39
  • 1
    Oh my, I feel your pain. – Dummy00001 Aug 02 '10 at 19:12
  • 1
    Ctrl sucks on the macbooks. I've been dealing with it, but one huge help for me was remapping CapsLock to "help" and then *map . I figure you gotta hit escape even more than ctrl, so might as well make it easy to access! – dash-tom-bang Sep 03 '10 at 23:54
  • 1
    what about remapping your keyboard? I for one remap ctrl on all my keyboards to the caps lock key. Makes it way easier.. – Doon Aug 01 '10 at 03:15
  • I am aware that this is a common solution, but as I stated, I want to avoid solutions that go beyond the scope of .vimrc if I can. – David Rivers Aug 01 '10 at 03:29
  • 4
    you might be out of luck. vim doesn't get a `ctrl` and then a `v` from the os, it just gets a `C-v` all at once, vim doesn't handle the ctrl keystrokes itself. – Alligator Oct 05 '11 at 10:51

1 Answers1

12

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.

Araxia
  • 1,136
  • 11
  • 22
  • 5
    I'm very reluctantly accepting this answer. After 594 views over the past year and no solutions proposed, I suppose that vim is for once incapable of such a task. – David Rivers Dec 13 '11 at 02:33
  • 1
    @iconoclast, Why did you bother adding to this discussion about a text editor you seem to despise? – David Rivers May 08 '13 at 19:33
  • How about exchanging the roles of Control and Option instead of remapping Caps Lock? Plays well with tmux and also makes it easy to type EOF. – lambdakappatheta Dec 23 '21 at 22:48