4

How can I input commands such as <Ctrl-W> and <Ctrl-]> in vim using Cmd instead of Ctrl? The reason why I want to do it is because it's more comfortable. When I need to switch to a different split, for example, it's way more cumbersome to place my fingers on Ctrl than on Cmd. I'm sure many of you have also met with this problem, but I can't seem to find any resolutions online, other than "just use Ctrl".

2
  • Suggest you broaden your question to "How can I remap the command key to Control key in OS X?" to broaden it, will cover many more cases and future searches.
    – gosmond
    Commented Feb 23, 2013 at 23:35
  • 1
    @gosmond Disagree. I have KeyRemap4Macbook and re-mapped cmd to ctl. However that remapping does not get respected in either vi, vim or macvim. Therefore this question is completely appropriate to be specific for vim. Commented May 23, 2015 at 6:53

2 Answers 2

1

There is an app called Keymando that I think can do this. Not sure if you can specify to do it only in Vim but you can specify to remap CTRL to CMD in Terminal.

When you've installed Keymando, put this in your config

only /Terminal/ do
    map "<Ctrl>", "<Cmd>"
end
1
  • The link is broken
    – Elazar
    Commented Jul 4, 2018 at 5:32
0

The application "KeyReMap4MacBook" should do what you want.

Additional suggestions via other methods:

https://askubuntu.com/questions/42907/how-do-i-remap-command-key-to-be-the-control-key-on-a-macbook-4-1

https://superuser.com/questions/263647/how-would-i-remap-mac-cmd-to-ctrl-keys-in-remote-desktop-connection-for-mac-appl

1
  • I am using KeyRemap4MacBook and the command-ctrl swapping works for most apps- but not for vi/vim/macvim. Commented May 23, 2015 at 7:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .