primecoder.github.io

PrimeCoder GitHub Pages

Follow me on GitHub

🏡 Home > 📍

Xcode 12.3 with Xvim Plugin

2020.12.20

I couldn’t stand any more. I kept entering vim command into my swift code and resulted in compile errors too often - you know, like ‘:w’. The last Xcode upgrade broke my XVim2 plugin. I gave it another try with the latest Xcode.

It worked! :-)

Xcode with Vim

This was how I did it.

First, backup your Xcode. I copied /Application/Xcode.app -> /Application/Xcode-vim.app. Yes, you can have mutliple versions of Xcode.

Now, you need the XVim plugin source. See: https://github.com/XVimProject/XVim2

$ git clone https://github.com/XVimProject/XVim2.git

Next, you need to generate self-signed certificate. Just follow the instructions here: https://github.com/XVimProject/XVim2/blob/master/SIGNING_Xcode.md

Once, that was done, you will have the certificate stored in your keychain. Just remember the name, you will need it for the next step.

Next, re-sign your Xcode - remember to re-sign the right Xcode.

$ sudo codesign -f -s XcodeSigner /Applications/Xcode-vim.app

On my MBP (2020), this took almost 8 min.

Next, you are ready to build XVim2 plugin. But, first, make sure xcode-select is pointing to the right Xcode.

$ xcode-select -s /Applications/Xcode-vim.app/Contents/Developer

Now, make the plugin.

$ cd TO_WHERE_YOUR_XVIM2_FOLDER
make

This took another 5-10 min. I restarted my new Xcode. Worked!

So far, so good. I will keep update of how it goes.