Xcode's Vim Mode - further development?

It was fantastic news to hear, last year, that Xcode was getting a Vim mode. Apple's implementation of it was a great first step, but it was missing a bunch of key features. Most importantly the dot command (and by, extension, macros) and creating marks in files, which are functions that I use/rely on on a daily basis.

I thought I would finally be able to stop having to self-sign Xcode (which causes problems) in order to use XVim2 plugin, but no such luck.

Will these features get added in for Xcode 14 (they don't seem to be in the beta) or are they far out on the roadmap?

Post not yet marked as solved Up vote post of electricRGB Down vote post of electricRGB
3.5k views

Replies

I severely need the ability to move up/down within lines that have been wrapped across multiple lines without jumping to the next line

  • Like in any other implementation of vim, type "gj" and "gk" to move up and down wrapped lines.

  • thanks. in vim, there is a setting to control this behavior without needing gj gk, so I forgot those existed.

Add a Comment

I'm still constantly tapping gd to try to jump to definition. That one at least seems like it should be trivial to add.

  • gd . and Ctrl-O would be the most useful to me

Add a Comment

Xcode vim mode got me really excited, but it is just missing a few commands that I depend on:

  • . (repeat, this is crucial)
  • Ctrl+v (column/vertical select), and Shift+I (insert in all lines of a vertical select)

And to a lesser degree I also use these often:

  • Ctrl+a, Ctrl+x (increment, decrement)
  • :w (save because it's annoying to mentally switch between to Cmd+s)
  • :%s/<find_exp>/<replace_str>/g
  • This is the real deal. . operator is the biggest, and multi line editing is definitely a top one. Saving and replacing are also must haves. If these can be added the vim mode will still be bare bones, but have just enough to be fully usable without feeling hindered.

Add a Comment

It should be possible and relatively straightforward to add true vim support using Neovim, and given that Xcode 14 disabled plugins and made it impossible to use XVim2, this is increasingly critical. I feel seriously handicapped!

Without these, I have a very hard time using it:

  • Macros (q to record, @ to replay)
  • Visual mode + g to highlight lines
  • %s/foo/bar/g
  • . to repeat last command
  • Support for even a limited version of .vimrc

After mourning the death of AppCode and XVim, and being highly frustrated with Xcode 13's Vim mode, I started working on a very different approach: a macOS app integrating Neovim in Xcode. The first version is promising and I'm already using it for my daily work.

Come check it out: ShadowVim

Highlights

  • This is not a Vim emulation, but real Neovim with macros, ., Ex commands, etc.
  • Vim plugins (without UI) work out of the box. Hello vim-surroundargtextobj.vim and whatnot.
  • Add key mappings to trigger native Xcode features from Neovim (e.g. "Jump to Definition" on gd).

I imagine for many people, like myself, having Vim support in an IDE is essential for an ergonomic development experience. Please let us know if there's anything we can help with to accelerate the development Vim support in Xcode, whether it be contributions or testing. It would mean the world.

Every Xcode release, I look for vim mode improvements, and, since release, I've seen only 1?

It's very frustrating having to develop without proper Vim support.

Please Apple, either implement Neovim under the hood, or add critical features of vim like the dot command, and macros.