LoginSignup
2
1

More than 3 years have passed since last update.

XcodeでVimキーバインドを利用する方法

Posted at

概要

SwiftUIでiOSネイティブ開発をすることになった.
慣れたVimキーバインドで開発をしたいが,IDE(Xcode)なしでネイティブ開発するのは辛すぎる...
そこで,XcodeでVimキーバインドを利用するように設定する.
具体的には,XVim2というXcodeの 3rd party extension を導入する.
XCode 8 以降は 3rd party extension の導入を前提とした設計になっていないので,KeychainAccessなどの設定を自分ですることになる.

本記事での環境

  • macOS Big Sur (version 11.1)
  • Xcode Version 12.4 (12D4e)

手順

code sign certificate の準備

~/Application/KeychainAccess.app を開く.
下図の通り,Certificate Assistant -> Create a Certificate を開く.
image.png

「Create Your Certificate」のウィンドウが新しく開くので,適当なNameを設定し,Certificate Type を Code Signingにする.
Done を選択
image.png

Xcodeの再署名

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

結構,実行には時間がかかる.

XVim2のクローンとmake

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

makeする

cd XVim2
make

Xcodeの起動

Xcode.appを開く.
起動時に,bundleを読み込むかどうか聞かれるので,読み込むを選択する.
上記の手順が正しくできてインストールされていれば,vimキーバインドを使うことができる.
どのようなキーバインドが使えるかは,feature listに記載されている.

以上

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1