Is there any way to have Vim key bindings in Xcode?
-
1This might sound stupid, but why not just use vim if you've become a fan of it? – theIV May 15 '11 at 22:54
-
18Code completion, debugging support, and a million other reasons... – Chris May 15 '11 at 23:30
-
Totally valid. I was more curious than anything else seeing, that there are plugins for a million things. – theIV May 16 '11 at 00:31
-
3Arg, I'm willing to pay $99+ for something like this (just like I did with ViEmu on MSVS). (This will be funny considering Xcode 4 itself is about $3.99) – kizzx2 Jun 17 '11 at 18:21
9 Answers
If you still interested in Vim keybinding plugin for Xcode I made one. Here it is. http://programming.jugglershu.net/softwares/xvim.html
This is currently developed for personal (my) use. So you may feel bad with some lack of implementation. Give me a feed back(feature request) then. I'll add some keybinds if I have enough time.

- 33,281
- 23
- 160
- 191

- 1,164
- 11
- 19
-
10This plugin is now developed under github and improved every day. I definitely can recommend this with confident for who want Vim key binding with Xcode4 – Shu Suzuki May 13 '12 at 11:56
@pkamb's answer is correct, but slightly out of date. In the Xcode 13 GM, Apple tweaked how to enable Vim keybindings.
To improve access to the Vim Mode, Xcode replaced the Enable Vim key bindings preference with an Edit > Vim Mode menu item. (75491567)

- 16,391
- 3
- 51
- 58
-
As a funny side note: this option is **only** available in proper Xcode *projects* -- the option /applies/ to Xcode playgrounds, but is not shown in the Editor menu, hence, can also not be deactivated there. Very weird! (I am on Xcode 13.1) – Paul Dec 06 '21 at 10:59
Xcode 13 in 2021 has added native Vim key binding support:
Xcode > Preferences > Text Editing > Editing > Enable Vim key bindings
https://developer.apple.com/xcode/
Vim mode
Many common key combinations and editing modes familiar to Vim users are supported directly within the code editor, using the new bottom bar to show mode indicators.

- 33,281
- 23
- 160
- 191
I use MacVim as editor instead xcode. For code completion i use vim plugin named clang_complete - awesome plugin.

- 21
- 1
I myself use and really appreciate Shu's XVim, but for completeness and in case you're still interested, just recently viemu has opened its beta for Xcode, you can check it out at
http://www.viemu.com/blog/2013/05/01/viemu-for-xcode-public-beta-available/

- 2,769
- 4
- 29
- 32
I haven't tried it yet, but there's also $20 ViCiOUS. Right now, I use Shu's XVim plugin (cf. his answer), and recommend it.

- 11,602
- 10
- 68
- 118
ViEmu is finally available for Xcode, check it out. It uses the same vim emulation engine that they are using for their Visual Studio plug-in, so all the polishing that has been added to the product since 2005 is there.
I'm not affiliated to them, but I tested ViEmu and if it was available for Xcode 5, I would have paid for a license.

- 11,599
- 22
- 79
- 140
Try Editor -> Vim Mode
in Xcode =>13.
It supports most of the common key bindings but there are exceptions, which is understandable given it's a relatively new feature. Most notably for me is the lack of support for a .vimrc
file so if you want that (or just want more features) you can still use https://github.com/XVimProject/XVim2. Judging by the current maintainer it might eventually be made redundant by Xcode's default vim support but it still works well for me.

- 3,389
- 23
- 39