1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Apple Silicon Mac で Neovim v0.9.5 をローカルビルドする手順

Posted at

はじめに

vscodeやcursorの拡張機能からnvimを使っているが、v10からnvimとの同期がちょくちょく切れる。
v0.9.5に戻せばこの現象が回避できる模様なので、個人的なメモとして残す。

前提

•	M1 Mac (Apple Silicon)
•	OS: macOS Sonoma
•	Homebrewがインストール済み
•	Neovimの init.lua など設定準備済み

やること一覧

1. 必要パッケージのインストール

brew install ninja cmake gettext
brew install libtool automake cmake pkg-config unzip curl doxygen
brew install luv libtermkey libvterm tree-sitter msgpack
brew install luajit

2. luarocks で Lua module (lpeg, mpack) をインストール

brew install luarocks

luarocks でインストール

luarocks --lua-dir=/opt/homebrew/opt/luajit install lpeg
luarocks --lua-dir=/opt/homebrew/opt/luajit install mpack
luarocks --lua-dir=/opt/homebrew/opt/luajit install lpeg

3. Neovim ソースコードをクローン

git clone https://github.com/neovim/neovim.git
cd neovim
git checkout v0.9.5

4. CMakeで設定 (build)

make CMAKE_BUILD_TYPE=RelWithDebInfo USE_BUNDLED=OFF

【ポイント】
• USE_BUNDLED=OFFにするとローカルのbrewパッケージを使う
• これでダウンロードなしでビルドだけする

5. ビルド

cd build
ninja

6. インストール

sudo ninja install

(【注意】 make installだと.depsもやり直すのでNG)

7. バージョン確認

nvim --version

以下が出れば成功。

NVIM v0.9.5
LuaJIT 2.1.xxxxxxxx

8. settings.jsonの変更

which nvim
/usr/local/bin/nvim

の場合、vscodeのsettings.jsonの以下を変更

 "vscode-neovim.neovimExecutablePaths.darwin": "/usr/local/bin/nvim",
1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?