Here’s a handy collection of the “Vim tip of the day” posts that I’ve made so far.

I am a huge Vim fan. I’ve used it for years and have gotten to the point where I’m pretty fast with entering/editing text using it. The beauty of using Vim commands is that you can rapidly modify text without taking your hands off of the keyboard. When I first started using Xcode it crushed me when I realized there wasn’t a built-in option to use Vim commands. I am so much faster when I’m able to use them and I’ve felt like I’ve had one hand tied behind my back until now. I know there were third-party solutions but having it being an official part of Xcode is what I really wanted. This Indie Life Unfolding comic from Limited DFS and TopoloGiraffe, the creators of Bluebird app, sums up exactly how I felt when when I learned Vim commands were being added to Xcode 13.

A comic about Vim. The bear rides slowly until Vim mode is enabled.

These posts that I’ve been making actually started out as a joke based off of some friendly (?) banter between Dave Jacobsen and myself. By the way, if you’ve never seen Dave’s YouTube videos you should really check them out. His “My Top Charts iOS App” video is a favorite of mine.

It got some good feedback so I kept doing it. I’m running out of source material so it seemed like a good time to make a collection of my posts. I’ll add to this blog entry as I post more tips.

Of course you can use these commands in other applications that support Vim commands. This was just my experience trying them out in Xcode to see what was/wasn’t available. Also, there are multiple ways to do the same thing with Vim commands. These might not be these best way. They are just an option available to try.

Jump past words and change to the end of the line

Reverse case

Different behavior when deleting a character

I filed feedback about this not working as expected. Much appreciated that it was corrected.

Jumping to the top/bottom of the file

Deleting a word or multiple words

Yanking a word or multiple words

It turns out that if you try to yank more than one word Xcode gets into a strange state where you can’t use standard Vim commands to move the cursor and you can’t hit “i” to enter insert mode. You can only hit esc to get out and the words aren’t yanked. I filed feedback FB9768086 about this one.

Yank from in a word

Swap two characters

Insert at beginning or end of line

Jump past punctuation in words

Attach the line below to the current line

Easily replace the current line

Jump to matching character

‘Change Word’ lets you paste text

When you change a word you don’t have to type the replacement. You can just paste text!

Did you know that if you click on a symbol in the SF Symbols app there is a “Copy Name” option in the “Edit” menu? That will save you from having to type “externaldrive.fill.badge.person.crop”.

The Edit Menu from the SF Symbols app. “Copy Name” is highlighted.

Different text can be pasted

Text put in a Vim register is different than text you copy/cut with standard Mac commands.

Searching and moving on the same line

You can search for a character and move the cursor to it or NEXT to it.

What’s missing

The Vim commands added to Xcode so far have been a great start. What would I like to see added next?

  1. The "Dot" command - This is easily my most used Vim command and it’s painful not having it available. The “dot” command lets you repeat the last Vim command you executed. Deleted five lines? Well you can delete five more lines with just one key press. Changed two words? You can make the same change to two other words with just one key press. This is incredibly powerful.
  2. Marks - I’m used to “marking” a starting point in my code and then marking an end point. After doing that it’s easy to copy or delete whatever comes between those two marks. It’s also so useful to jump back to a section of code you’ve marked.
  3. Ex commands - I’m also used to transforming an entire file quickly with Ex commands. An example of how I do this is mentioned in a previous blog post that I made. Yes, you could easily accomplish the same thing with Xcode’s search/replace functionality but I’m really proficient at these commands and can enter them quickly without having to take my hands off of the keyboard.


Big thanks to the Xcode team at Apple for adding Vim commands to Xcode.

Shout out to Vim Cheat Sheet for refreshing my memory on some commands and teaching me some new commands!

If this post was helpful to you I’d love to hear about it! Find me on Twitter.