LoginSignup
34
14

More than 1 year has passed since last update.

XcodeでXVim2を導入する手順

Last updated at Posted at 2019-04-09

はじめに

XcodeでXVim2を導入する手順をまとめた記事となります。

動作環境

以下のXcodeバージョンにて期待する挙動を確認できています。
* Xcode 12.4
* Xcode 11.x
* Xcode 10.x

導入手順

1. Xcodeのインストール先を確認

# インストール先の確認
$ xcode-select -p
# 適切なインストール先は以下の通り
-> /Applications/Xcode.app/Contents/Developer/

Xcode上からでも確認・変更可能

Xcode -> Preferences -> Locations -> Command Line Tools

2. Signing Xcode

公式サイトを参考にSingingを行う

証明書の作成

キーチェーンアクセス > 証明書の作成

スクリーンショット 2021-02-22 18.46.41.png

Xcodeの再署名

# AppStoreからダウンロードした場合
$ sudo codesign -f -s XcodeSigner /Applications/Xcode.app

3. XVim2の初期設定を行う

# インストールディレクトリに移動 - 任意の場所で問題ありません
cd ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/
# XVim2をclone - 任意の場所で問題ありません
git clone https://github.com/XVimProject/XVim2.git
# XVim2直下のディレクトリに移動
cd XVim2
# makeコマンド実行
make

# インストール後 XVim2.xcplugin が存在するか確認する方法
ls -l ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/

追記

/Xcode/Plug-ins配下にXVim2.xcpluginが存在しないことで期待する挙動を確認できない恐れがあります。
私の場合、make時に生成される/XVim2/build/Reaeaseのディレクトリに存在していたため、/Xcode/Plug-ins配下にXVim2.xcpluginをコピーすることで解消しました。

$ ls ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/XVim2/build/Release
-> XVim2.xcplugin
$ cp -r build/Release/XVim2.xcplugin ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins  
# /Xcode/Plug-ins 配下に XVim2.xcplugin が存在するか再度確認
$ ls -l ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/ 

4. Xcodeを再起動

  • Xcodeを開いている場合は終了(command+q)してから起動
  • 選択画面が表示されるのでLoad bundle を選択

最後に

お疲れ様でした🎉
少しでも誰かの役に立つことを願って:pray:

関連資料

XVim2 - GitHub

追記:選択画面が表示されない場合

Case 1. Skip bundleを押してしまった、もしくは表示されなかった場合は下記を行う

# Xcode-X.X: 自身が使用されているXcodeのバージョン
$ defaults delete com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-X.X

Case 2. case1を適用してもが表示されなかった場合

# Xcode8以降でプラグインを使用するには、Xcodeの署名を解除
$ update_xcode_plugins --unsign

Case 3. Xcodeをアップデートした場合

再度署名書発行のステップ(2. Signing Xcode)からやり直す必要があります。

34
14
2

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
34
14