[!NOTE|label:references:]

install

[!NOTE]

dependencies

  • osx

    • gettext : GNU internationalization (i18n) and localization (l10n) library
    • libtermkey : Library for processing keyboard entry from the terminal
    • libuv : Multi-platform support library with a focus on asynchronous I/O
    • libvterm : C99 library which implements a VT220 or xterm terminal emulator
    • luajit : Just-In-Time Compiler (JIT) for the Lua programming language
    • luv : Bare libuv bindings for lua
    • msgpack : Library for a binary-based efficient data interchange format
    • tree-sitter : Parser generator tool and incremental parsing library
    • unibilium: Very basic terminfo library
    $ brew deps --tree neovim
    neovim
    ├── gettext
    ├── libtermkey
    │   └── unibilium
    ├── libuv
    ├── libvterm
    ├── luajit
    ├── luv
    │   └── libuv
    ├── msgpack
    ├── tree-sitter
    └── unibilium
    

nvim development (prerelease) build

  • tarball

    [!TIP]

    • osx: avoid unknown developer warning
      $ xattr -c ./nvim-macos.tar.gz
      # or
      $ xattr -p com.apple.quarantine ./nvim-macos.tar.gz
      
    $ curl -fsSL https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz | tar xzf - -C /opt/nvim
    $ /opt/nvim/nvim-macos/bin/nvim
    $ sudo ln -sf /opt/nvim/nvim-macos /usr/local/nvim
    
    $ export NVIM_HOME=/usr/local/nvim
    $ export PATH=$NVIM_HOME/bin:$PATH
    

building from source

[!NOTE|label:references:]

osx

[!NOTE|label:issue with wget certificate]

# prepare
$ xcode-select --install
$ brew install ninja libtool automake cmake pkg-config gettext curl
# or
$ brew install cmake gettext lpeg luarocks luajit luv msgpack tree-sitter unibilium \
               libtermkey libuv libvterm

# download
$ git clone --recurse-submodules git@github.com:neovim/neovim.git /opt/neovim && cd $_

# build
$ cmake -S . \
        -B build \
        -DCMAKE_INSTALL_PREFIX=/usr/local/neovim \
        -DLUV_LIBRARY=/usr/local/opt/luv/lib/libluv.dylib \
        -DLIBUV_LIBRARY=/usr/local/opt/libuv/lib/libuv.dylib \
        -DLPEG_LIBRARY=/usr/local/opt/lpeg/lib/liblpeg.dylib \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_FIND_FRAMEWORK=LAST \
        -DCMAKE_VERBOSE_MAKEFILE=ON \
        -Wno-dev \
        -DBUILD_TESTING=OFF \
        -DCMAKE_OSX_SYSROOT=$(xcrun --show-sdk-path)
$ cmake --build build
$ sudo cmake --install build

# verify
$ /usr/local/neovim/bin/nvim -V1 -v
NVIM v0.10.0-dev-2869+g4459e0cee
Build type: Release
LuaJIT 2.1.1710088188

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/neovim/share/nvim"

Run :checkhealth for more info

# environment setup
$ NVIM_HOME=/usr/local/neovim
$ PATH=$NVIM_HOME/bin:$PATH
$ export NVIM_HOME PATH
brew install --head with macOS SDk14
# https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/n/neovim.rb
$ cmake -S . \
        -B build \
        -DCMAKE_INSTALL_PREFIX=/usr/local/neovim \
        -DLUV_LIBRARY=/usr/local/opt/luv/lib/libluv.dylib \
        -DLIBUV_LIBRARY=/usr/local/opt/libuv/lib/libuv.dylib \
        -DLPEG_LIBRARY=/usr/local/opt/lpeg/lib/liblpeg.dylib \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_FIND_FRAMEWORK=LAST \
        -DCMAKE_VERBOSE_MAKEFILE=ON \
        -Wno-dev \
        -DBUILD_TESTING=OFF \
        -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
neovim-nighly: install via cc
$ /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc \
    -O2 -g -Og -g -flto=thin \
    -Wall \
    -Wextra -pedantic \
    -Wno-unused-parameter \
    -Wstrict-prototypes -std=gnu99 \
    -Wshadow \
    -Wconversion \
    -Wvla \
    -Wdouble-promotion \
    -Wmissing-noreturn \
    -Wmissing-format-attribute \
    -Wmissing-prototypes -fsigned-char -fstack-protector-strong \
    -Wimplicit-fallthrough -fdiagnostics-color=always \
    -Wl,-export_dynamic \
    -DUNIT_TESTING \
    -DHAVE_UNIBILIUM \
    -D_GNU_SOURCE \
    -DINCLUDE_GENERATED_DECLARATIONS \
    -I/Users/runner/work/neovim/neovim/.deps/usr/include/luajit-2.1 \
    -I/Users/runner/work/neovim/neovim/.deps/usr/include \
    -I/Users/runner/work/neovim/neovim/build/src/nvim/auto \
    -I/Users/runner/work/neovim/neovim/build/include \
    -I/Users/runner/work/neovim/neovim/build/cmake.config \
    -I/Users/runner/work/neovim/neovim/src \
    -I/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include

# details
$ /usr/local/bin/nvim -V1 -v
NVIM v0.10.0-dev-2867+g7aa56370f
Build type: RelWithDebInfo
LuaJIT 2.1.1710088188
Compilation: /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -O2 -g -Og -g -flto=thin -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fsigned-char -fstack-protector-strong -Wimplicit-fallthrough -fdiagnostics-color=always -Wl,-export_dynamic -DUNIT_TESTING -DHAVE_UNIBILIUM -D_GNU_SOURCE -DINCLUDE_GENERATED_DECLARATIONS -I/Users/runner/work/neovim/neovim/.deps/usr/include/luajit-2.1 -I/Users/runner/work/neovim/neovim/.deps/usr/include -I/Users/runner/work/neovim/neovim/build/src/nvim/auto -I/Users/runner/work/neovim/neovim/build/include -I/Users/runner/work/neovim/neovim/build/cmake.config -I/Users/runner/work/neovim/neovim/src -I/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info
  • build with older MacOS

    $ make CMAKE_BUILD_TYPE=Release \
           MACOSX_DEPLOYMENT_TARGET=10.13 \
           DEPS_CMAKE_FLAGS="-DCMAKE_CXX_COMPILER=$(xcrun -find c++)"
    
  • more settings

    $ brew unlink neovim
    $ /usr/bin/env /bin/ln -h -s -f /usr/local/neovim/bin/nvim /usr/local/bin/nvim
    $ /usr/bin/env /bin/ln -h -s -f /usr/local/neovim/bin/nvim /usr/local/bin/neovim
    $ /usr/bin/env /bin/ln -h -s -f /usr/local/neovim/lib/nvim /usr/local/lib/nvim
    $ /usr/bin/env /bin/ln -h -s -f /usr/local/neovim/share/nvim /usr/local/share/nvim
    

brew install -v --debug

[!NOTE|label:references:]

# download
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.2.17-33-g1bbfe76\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 14.4.1\)\ curl/8.4.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://raw.githubusercontent.com/Homebrew/homebrew-core/841811d678fcfef856f693a2ec90add1625a4c12/Formula/n/neovim.rb
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.2.17-33-g1bbfe76\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 14.4.1\)\ curl/8.4.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head --request GET https://raw.githubusercontent.com/Homebrew/homebrew-core/841811d678fcfef856f693a2ec90add1625a4c12/Formula/n/neovim.rb
# clone
$ /usr/bin/env git --git-dir /Users/marslo/Library/Caches/Homebrew/neovim--git/.git status -s
$ /usr/bin/env git checkout -f master --
$ /usr/bin/env git --git-dir /Users/marslo/Library/Caches/Homebrew/neovim--git/.git rev-parse --short=7 HEAD
$ /usr/bin/env git --git-dir /Users/marslo/Library/Caches/Homebrew/neovim--git/.git show -s --format=\%cD
Wed, 10 Apr 2024 07:08:49 +0800

# build
# MacOSX15
$ cmake -S . -B build \
        -DLUV_LIBRARY=/usr/local/opt/luv/lib/libluv.dylib \
        -DLIBUV_LIBRARY=/usr/local/opt/libuv/lib/libuv.dylib \
        -DLPEG_LIBRARY=/usr/local/opt/lpeg/lib/liblpeg.dylib \
        -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-0985e78 \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_FIND_FRAMEWORK=LAST \
        -DCMAKE_VERBOSE_MAKEFILE=ON \
        -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake \
        -Wno-dev \
        -DBUILD_TESTING=OFF \
        -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
$ cmake --build build
$ cmake --install build

# MacOSX14
$ cmake -S . -B build \
        -DLUV_LIBRARY=/usr/local/opt/luv/lib/libluv.dylib \
        -DLIBUV_LIBRARY=/usr/local/opt/libuv/lib/libuv.dylib \
        -DLPEG_LIBRARY=/usr/local/opt/lpeg/lib/liblpeg.dylib \
        -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-f494084 \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_FIND_FRAMEWORK=LAST \
        -DCMAKE_VERBOSE_MAKEFILE=ON \
        -Wno-dev \
        -DBUILD_TESTING=OFF \
        -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
$ cmake --build build
$ cmake --install build
full steps
# -- package downlaod --
# downloading https://ghcr.io/v2/homebrew/core/lpeg/manifests/1.1.0-1
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --fail --retry 3 --header Accept:\ application/vnd.oci.image.index.v1+json --header Authorization:\ Bearer\ QQ== --remote-time --output /Users/marslo/Library/Caches/Homebrew/downloads/5906a2786f22dd74352335366e9b152ed78248ffa0b9aefb61209bbcdfb96581--lpeg-1.1.0-1.bottle_manifest.json.incomplete --location https://ghcr.io/v2/homebrew/core/lpeg/manifests/1.1.0-1

# downloading https://ghcr.io/v2/homebrew/core/lpeg/blobs/sha256:8d5ac91544867d83ce0ec6f407e6a3ead572ccbd523234d2673322da355435fb
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --fail --retry 3 --header Authorization:\ Bearer\ QQ== --remote-time --output /Users/marslo/Library/Caches/Homebrew/downloads/64b9165704b80c38d985d9114800b67538d74206e753479a064d1de4274783ae--lpeg--1.1.0.sonoma.bottle.1.tar.gz.incomplete --location https://ghcr.io/v2/homebrew/core/lpeg/blobs/sha256:8d5ac91544867d83ce0ec6f407e6a3ead572ccbd523234d2673322da355435fb

# downloading https://ghcr.io/v2/homebrew/core/luajit/manifests/2.1.1736781742
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --fail --retry 3 --header Accept:\ application/vnd.oci.image.index.v1+json --header Authorization:\ Bearer\ QQ== --remote-time --output /Users/marslo/Library/Caches/Homebrew/downloads/24274d382a6b6a99d66237d64e3c2780fcd4fc179873af1c030640f8fa3272c7--luajit-2.1.1736781742.bottle_manifest.json.incomplete --location https://ghcr.io/v2/homebrew/core/luajit/manifests/2.1.1736781742

# downloading https://ghcr.io/v2/homebrew/core/luajit/blobs/sha256:fbcaa9ad4a184e2e4f1926f46e9917dbf81b7809eeb373eb9478e1ca57fbc572
$ /uSr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --fail --retry 3 --header Authorization:\ Bearer\ QQ== --remote-time --output /Users/marslo/Library/Caches/Homebrew/downloads/44e0a7fb4ea0b9964daff356cd16a93de40d4bf096cce47fada80235095eee61--luajit--2.1.1736781742.sonoma.bottle.tar.gz.incomplete --location https://ghcr.io/v2/homebrew/core/luajit/blobs/sha256:fbcaa9ad4a184e2e4f1926f46e9917dbf81b7809eeb373eb9478e1ca57fbc572

# downloading https://ghcr.io/v2/homebrew/core/luv/manifests/1.50.0-0
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --fail --retry 3 --header Accept:\ application/vnd.oci.image.index.v1+json --header Authorization:\ Bearer\ QQ== --remote-time --output /Users/marslo/Library/Caches/Homebrew/downloads/f7df8fdec3d84a4438fb414d9be8a6412a897c493ed21aa06a3704137c3d9abf--luv-1.50.0-0.bottle_manifest.json.incomplete --location https://ghcr.io/v2/homebrew/core/luv/manifests/1.50.0-0

# downloading https://ghcr.io/v2/homebrew/core/luv/blobs/sha256:29aa7d58757c2219fc4f5a80ee7b9626e24830536ee03fa44a50da5a19b16c4a
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --fail --retry 3 --header Authorization:\ Bearer\ QQ== --remote-time --output /Users/marslo/Library/Caches/Homebrew/downloads/96e3e0360db63fef9052f78aa5cb84c1124897bdd06071ace3be33c74d11df19--luv--1.50.0-0.sonoma.bottle.tar.gz.incomplete --location https://ghcr.io/v2/homebrew/core/luv/blobs/sha256:29aa7d58757c2219fc4f5a80ee7b9626e24830536ee03fa44a50da5a19b16c4a

# downloading https://ghcr.io/v2/homebrew/core/unibilium/manifests/2.1.2
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --fail --retry 3 --header Accept:\ application/vnd.oci.image.index.v1+json --header Authorization:\ Bearer\ QQ== --remote-time --output /Users/marslo/Library/Caches/Homebrew/downloads/2d9cd8927f7cd1da5e432d934cb2f5c4d09314fba2531033031bca58d817cb1c--unibilium-2.1.2.bottle_manifest.json.incomplete --location https://ghcr.io/v2/homebrew/core/unibilium/manifests/2.1.2

# downloading https://ghcr.io/v2/homebrew/core/unibilium/blobs/sha256:19a58769977601b8bbc47959efeefb4bad5cc938d7dcde0c083c8227d8296026
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --fail --retry 3 --header Authorization:\ Bearer\ QQ== --remote-time --output /Users/marslo/Library/Caches/Homebrew/downloads/a3d626c1761646e68b628b37bedc590b31a45e036fce5d7dbbb6a95eef2eb3bf--unibilium--2.1.2.sonoma.bottle.tar.gz.incomplete --location https://ghcr.io/v2/homebrew/core/unibilium/blobs/sha256:19a58769977601b8bbc47959efeefb4bad5cc938d7dcde0c083c8227d8296026

# downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/e0883566a68ab8403f399fc4e616977ecdfe7c66/Formula/n/neovim.rb
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --retry 3 -V
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://raw.githubusercontent.com/Homebrew/homebrew-core/e0883566a68ab8403f399fc4e616977ecdfe7c66/Formula/n/neovim.rb
$ /usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.4.19-77-g7ce65c2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 15.1.1\)\ curl/8.7.1 --header Accept-Language:\ en --retry 3 --fail --location --silent --head --request GET --http1.1 https://raw.githubusercontent.com/Homebrew/homebrew-core/e0883566a68ab8403f399fc4e616977ecdfe7c66/Formula/n/neovim.rb

# cloning https://github.com/neovim/neovim.git
$ /usr/bin/env git --git-dir /Users/marslo/Library/Caches/Homebrew/neovim--git/.git status -s

# installing neovim --head
$ /usr/bin/env hdiutil imageinfo -format /Users/marslo/Library/Caches/Homebrew/neovim--git
$ /usr/bin/env cp -pR /Users/marslo/Library/Caches/Homebrew/neovim--git/.git-blame-ignore-revs /Users/marslo/Library/Caches/Homebrew/neovim--git/.clangd /Users/marslo/Library/Caches/Homebrew/neovim--git/cmake.config /Users/marslo/Library/Caches/Homebrew/neovim--git/.styluaignore /Users/marslo/Library/Caches/Homebrew/neovim--git/cmake.deps /Users/marslo/Library/Caches/Homebrew/neovim--git/CMakeLists.txt /Users/marslo/Library/Caches/Homebrew/neovim--git/test /Users/marslo/Library/Caches/Homebrew/neovim--git/cmake /Users/marslo/Library/Caches/Homebrew/neovim--git/Makefile /Users/marslo/Library/Caches/Homebrew/neovim--git/.luacheckrc /Users/marslo/Library/Caches/Homebrew/neovim--git/.clang-tidy /Users/marslo/Library/Caches/Homebrew/neovim--git/runtime /Users/marslo/Library/Caches/Homebrew/neovim--git/cmake.packaging /Users/marslo/Library/Caches/Homebrew/neovim--git/INSTALL.md /Users/marslo/Library/Caches/Homebrew/neovim--git/contrib /Users/marslo/Library/Caches/Homebrew/neovim--git/.editorconfig /Users/marslo/Library/Caches/Homebrew/neovim--git/README.md /Users/marslo/Library/Caches/Homebrew/neovim--git/CMakePresets.json /Users/marslo/Library/Caches/Homebrew/neovim--git/.luarc.json /Users/marslo/Library/Caches/Homebrew/neovim--git/.gitignore /Users/marslo/Library/Caches/Homebrew/neovim--git/CONTRIBUTING.md /Users/marslo/Library/Caches/Homebrew/neovim--git/BUILD.md /Users/marslo/Library/Caches/Homebrew/neovim--git/BSDmakefile /Users/marslo/Library/Caches/Homebrew/neovim--git/scripts /Users/marslo/Library/Caches/Homebrew/neovim--git/.clang-format /Users/marslo/Library/Caches/Homebrew/neovim--git/.github /Users/marslo/Library/Caches/Homebrew/neovim--git/.gitattributes /Users/marslo/Library/Caches/Homebrew/neovim--git/.cirrus.yml /Users/marslo/Library/Caches/Homebrew/neovim--git/.luacov /Users/marslo/Library/Caches/Homebrew/neovim--git/.mailmap /Users/marslo/Library/Caches/Homebrew/neovim--git/.git /Users/marslo/Library/Caches/Homebrew/neovim--git/LICENSE.txt /Users/marslo/Library/Caches/Homebrew/neovim--git/MAINTAIN.md /Users/marslo/Library/Caches/Homebrew/neovim--git/.stylua.toml /Users/marslo/Library/Caches/Homebrew/neovim--git/src /private/tmp/homebrew-unpack-20250201-3864-3o66e4
...
$ /usr/bin/env tar --extract --no-same-owner --file /Users/marslo/Library/Caches/Homebrew/downloads/39864b4f45c47ab339c58d6b5a5cae1916dbe2f3815880744242b0956624e829--tree-sitter-c-0.23.2.tar.gz --directory /private/tmp/homebrew-unpack-20250201-3864-fjuv0m

# -- dependencies build --
# treesitter-c
$ cmake -S /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/src/treesitter-c -B /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-c -DPARSERLANG=c -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-0985e78 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
$ cmake --build /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-c
$ cmake --install /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-c

# treesitter-lua
$ cmake -S /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/src/treesitter-lua -B /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-lua -DPARSERLANG=lua -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-0985e78 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
$ cmake --build /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-lua
$ cmake --install /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-lua

# treesitter-vim
$ cmake -S /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/src/treesitter-vim -B /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-vim -DPARSERLANG=vim -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-0985e78 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
$ cmake --build /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-vim
$ cmake --install /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-vim

# treesitter-vimdoc
$ cmake -S /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/src/treesitter-vimdoc -B /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-vimdoc -DPARSERLANG=vimdoc -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-0985e78 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
$ cmake --build /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-vimdoc
$ cmake --install /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-vimdoc

# treesitter-query
$ cmake -S /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/src/treesitter-query -B /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-query -DPARSERLANG=query -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-0985e78 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
$ cmake --build /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-query
$ cmake --install /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-query

# treesitter-markdown
$ cmake -S /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/src/treesitter-markdown -B /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-markdown -DPARSERLANG=markdown -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-0985e78 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
$ cmake --build /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-markdown
$ cmake --install /private/tmp/neovim-20250201-3864-gtr04h/deps-build/build/treesitter-markdown

# -- neovim build --
$ cmake -S . -B build -DLUV_LIBRARY=/usr/local/opt/luv/lib/libluv.dylib -DLIBUV_LIBRARY=/usr/local/opt/libuv/lib/libuv.dylib -DLPEG_LIBRARY=/usr/local/opt/lpeg/lib/liblpeg.dylib -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-0985e78 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
$ cmake --build build
$ cmake --install build

# -- link --
$ ln -s ../Cellar/neovim/HEAD-0985e78/bin/nvim nvim
$ ln -s ../../../../../Cellar/neovim/HEAD-0985e78/share/icons/hicolor/128x128/apps/nvim.png nvim.png
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/af/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/ca/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/cs/LC_MESSAGES/nvim.mo nvim.mo
$ mkdir -p /usr/local/share/locale/cs.cp1250
$ mkdir -p /usr/local/share/locale/cs.cp1250/LC_MESSAGES
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/cs.cp1250/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/da/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/de/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/en_GB/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/eo/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/es/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/fi/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/fr/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/ga/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/it/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/ja/LC_MESSAGES/nvim.mo nvim.mo
$ mkdir -p /usr/local/share/locale/ja.euc-jp
$ mkdir -p /usr/local/share/locale/ja.euc-jp/LC_MESSAGES
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/ja.euc-jp/LC_MESSAGES/nvim.mo nvim.mo
$ mkdir -p /usr/local/share/locale/ko.UTF-8
$ mkdir -p /usr/local/share/locale/ko.UTF-8/LC_MESSAGES
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/ko.UTF-8/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/nb/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/nl/LC_MESSAGES/nvim.mo nvim.mo
$ mkdir -p /usr/local/share/locale/no
$ mkdir -p /usr/local/share/locale/no/LC_MESSAGES
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/no/LC_MESSAGES/nvim.mo nvim.mo
$ mkdir -p /usr/local/share/locale/pl.UTF-8
$ mkdir -p /usr/local/share/locale/pl.UTF-8/LC_MESSAGES
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/pl.UTF-8/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/pt_BR/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/ru/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/sk/LC_MESSAGES/nvim.mo nvim.mo
$ mkdir -p /usr/local/share/locale/sk.cp1250
$ mkdir -p /usr/local/share/locale/sk.cp1250/LC_MESSAGES
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/sk.cp1250/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/sv/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/tr/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/uk/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/vi/LC_MESSAGES/nvim.mo nvim.mo
$ mkdir -p /usr/local/share/locale/zh_CN.UTF-8
$ mkdir -p /usr/local/share/locale/zh_CN.UTF-8/LC_MESSAGES
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/zh_CN.UTF-8/LC_MESSAGES/nvim.mo nvim.mo
$ mkdir -p /usr/local/share/locale/zh_TW.UTF-8
$ mkdir -p /usr/local/share/locale/zh_TW.UTF-8/LC_MESSAGES
$ ln -s ../../../../Cellar/neovim/HEAD-0985e78/share/locale/zh_TW.UTF-8/LC_MESSAGES/nvim.mo nvim.mo
$ ln -s ../../../Cellar/neovim/HEAD-0985e78/share/man/man1/nvim.1 nvim.1
$ ln -s ../Cellar/neovim/HEAD-0985e78/share/nvim nvim
$ ln -s ../Cellar/neovim/HEAD-0985e78/lib/nvim nvim

uninstall

$ sudo cmake --build build/ --target uninstall

package manager

# osx
$ brew install nvim

# nvim head
$ brew install --HEAD utf8proc
$ brew install --HEAD tree-sitter
$ brew install --HEAD neovim

# ubuntu
$ sudo add-apt-repository ppa:neovim-ppa/unstable
$ sudo add-apt-repository ppa:neovim-ppa/stable
$ sudo apt update
$ sudo apt install neovim
$ apt-cache madison neovim
    neovim | 0.10.0~ubuntu1+git202401142109-310fb2efc-c60402a16-3c3072a0a~ubuntu20.04.1 | https://ppa.launchpadcontent.net/neovim-ppa/unstable/ubuntu focal/main amd64 Packages
    neovim | 0.7.2-3~bpo22.04.1~ppa1 | https://ppa.launchpadcontent.net/neovim-ppa/stable/ubuntu jammy/main amd64 Packages
    neovim | 0.6.1-3 | http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages

# or
$ curl -fsSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/neovim/neovim_0.9.5-6ubuntu2_amd64.deb
$ sudo dpkg -i neovim_0.9.5-6ubuntu2_amd64.deb
  • brew install --head

    [!NOTE|label:references:]

    $ brew install --HEAD utf8proc
    $ brew install tree-sitter --HEAD
    $ brew install nvim --HEAD --debug -v
    # or
    $ brew install --build-from-source --HEAD --force --fetch-HEAD --keep-tmp neovim -v --debug
    
    # verify
    $ $(brew --cellar nvim)/*/bin/nvim -V1 -v
    NVIM v0.11.0-dev-1668+g0985e784d8-Homebrew
    Build type: Release
    LuaJIT 2.1.1736781742
    
       system vimrc file: "$VIM/sysinit.vim"
      fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-0985e78/share/nvim"
    
    Run :checkhealth for more info
    
    brew install --head with macOS SDK15 ( xcode v16 )

    [!NOTE|label:to get macOS SDK:]

    # handle tree-sitter-c-0.23.0.tar.gz
    $ /usr/bin/env tar --extract --no-same-owner --file /Users/marslo/Library/Caches/Homebrew/downloads/7afcc045b55375a996ccb8e98606e426e9c8a5465e82babf7997513a7763e077--tree-sitter-c-0.23.0.tar.gz --directory /private/tmp/homebrew-unpack20241014-59765-o7ouz3
    $ /usr/bin/env cp -al /private/tmp/homebrew-unpack20241014-59765-o7ouz3/tree-sitter-c-0.23.0 /private/tmp/treesitter-c-20241014-59765-41iwid
    
    # deps: treesitter-c
    $ cmake -S        /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/src/treesitter-c -B /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-c -DPARSERLANG=c -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-4846bf0_1 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
    $ cmake --build   /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-c
    $ cmake --install /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-c
    
    # deps: treesitter-lua
    $ cmake -S        /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/src/treesitter-lua -B /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-lua -DPARSERLANG=lua -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-4846bf0_1 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
    $ cmake --build   /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-lua
    $ cmake --install /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-lua
    
    # deps: treesitter-vim
    $ cmake -S        /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/src/treesitter-vim -B /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-vim -DPARSERLANG=vim -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-4846bf0_1 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
    $ cmake --build   /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-vim
    $ cmake --install /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-vim
    
    # deps: treesitter-vimdoc
    $ cmake -S /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/src/treesitter-vimdoc -B /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-vimdoc -DPARSERLANG=vimdoc -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-4846bf0_1 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
    $ cmake --build /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-vimdoc
    $ cmake --install /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-vimdoc
    
    # deps: treesitter-query
    $ cmake -S /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/src/treesitter-query -B /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-query -DPARSERLANG=query -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-4846bf0_1 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
    $ cmake --build /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-query
    $ cmake --install /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-query
    
    # deps: treesitter-markdown
    $ cmake -S /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/src/treesitter-markdown -B /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-markdown -DPARSERLANG=markdown -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-4846bf0_1 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
    $ cmake --build /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-markdown
    $ cmake --install /private/tmp/neovim-20241014-59765-vs8k2v/deps-build/build/treesitter-markdown
    
    # nvim
    $ cmake -S . \
            -B build \
            -DLUV_LIBRARY=/usr/local/opt/luv/lib/libluv.dylib \
            -DLIBUV_LIBRARY=/usr/local/opt/libuv/lib/libuv.dylib \
            -DLPEG_LIBRARY=/usr/local/opt/lpeg/lib/liblpeg.dylib \
            -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/HEAD-4846bf0_1 \
            -DCMAKE_INSTALL_LIBDIR=lib \
            -DCMAKE_BUILD_TYPE=Release \
            -DCMAKE_FIND_FRAMEWORK=LAST \
            -DCMAKE_VERBOSE_MAKEFILE=ON \
            -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/usr/local/Homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake \
            -Wno-dev \
            -DBUILD_TESTING=OFF \
            -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
    $ cmake --build build
    

windows

  • dependencies

    [!NOTE|label:references:]

    • C Compiler

      • llvm

        # C:\Program Files\LLVM\bin
        > choco install llvm
        
        # https://gist.github.com/mcandre/5ceb67ad44f6b974d33bcddedcb16e89
        > choco install cmake
        
      • mingw

        [!TIP|label:packages:]

        # C:\ProgramData\mingw64\mingw64
        > choco install mingw
        
      • msvc

        [!TIP|label:packages:]

        # C:\Program Files (x86)\Microsoft Visual Studio\Installer
        > choco install visualstudio2022buildtools
        
        # former version
        > choco install visualstudio2019buildtools
        
        # for clang/llvm installation
        # C:\Program Files (x86)\Microsoft Visual Studio\Installer
        > choco install visualstudio-installer
        
  • nvim
    > curl -fsSL -O https://github.com/neovim/neovim/releases/latest/download/nvim-win64.msi
    REM install via msiexec as administrator
    > msiexec /i nvim-setup.exe [/quiet] [/passive] [/norestart] [/log <log file>] [/l* <log file>]
    

neovim-nightly

[!NOTE|label:references:]

$ brew unlink neovim
Unlinking /usr/local/Cellar/neovim/HEAD-f494084... 35 symlinks removed.

$ brew tap benjiwolff/neovim-nightly
$ brew install neovim-nightly [ -v --debug ]

# verify
$ /usr/local/Caskroom/neovim-nightly/nightly-7aa5637/nvim-macos-x86_64/bin/nvim -V1 -v
NVIM v0.10.0-dev-2867+g7aa56370f
Build type: RelWithDebInfo
LuaJIT 2.1.1710088188
Compilation: /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -O2 -g -Og -g -flto=thin -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fsigned-char -fstack-protector-strong -Wimplicit-fallthrough -fdiagnostics-color=always -Wl,-export_dynamic -DUNIT_TESTING -DHAVE_UNIBILIUM -D_GNU_SOURCE -DINCLUDE_GENERATED_DECLARATIONS -I/Users/runner/work/neovim/neovim/.deps/usr/include/luajit-2.1 -I/Users/runner/work/neovim/neovim/.deps/usr/include -I/Users/runner/work/neovim/neovim/build/src/nvim/auto -I/Users/runner/work/neovim/neovim/build/include -I/Users/runner/work/neovim/neovim/build/cmake.config -I/Users/runner/work/neovim/neovim/src -I/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info
  • No such file or directory @ rb_file_s_rename

    [!TIP|label:failure details]

    error: benjiwolff/neovim-nightly/neovim-nightly: No such file or directory @ rb_file_s_rename - (/usr/local/Caskroom/neovim-nightly/nightly-7aa5637, /usr/local/Caskroom/neovim-nightly/nightly-7aa5637.upgrading)
    
    # solution
    $ brew remove neovim-nightly
    $ rm -rf /usr/local/Caskroom/neovim-nightly
    
    $ brew install neovim-nightly [ -v --debug --display-times ]
    

initialize and configure

[!TIP]

provider

:checkhealth

$ python3 -m pip install --user --upgrade pynvim
$ gem install neovim
$ npm install -g neovim
  • for venv

    $ python3 -m pip install --upgrade pynvim
    # if necesssary
    $ python3 -m pip  install --upgrade greenlet
    
    # verify
    $ command python3 -c 'import sys; sys.path = [p for p in sys.path if p != ""]; import neovim; print(neovim.__file__)'
    
    # to list all packages
    $ pip list -v
    

init.vim/init.lua

[!NOTE|label:references:]

  • create init.vim

    :exe 'edit '.stdpath('config').'/init.vim'
    :write ++p
    
  • init.lua

    -- ~/.config/nvim/init.lua
    vim.cmd( 'set runtimepath^=~/.vim runtimepath+=~/.vim/after' )
    vim.cmd( 'let &packpath = &runtimepath' )
    vim.cmd( 'source ~/.vimrc' )
    vim.cmd( 'autocmd TextYankPost * silent! lua vim.highlight.on_yank {on_visual=false}' )
    
  • init.vim

    # ~/.config/nvim/init.vim
    set runtimepath^=~/.vim runtimepath+=~/.vim/after
    let &packpath = &runtimepath
    source ~/.vimrc
    autocmd TextYankPost * silent! lua vim.highlight.on_yank {on_visual=false}
    

yank/paste highlight

[!NOTE|label:references:]

config

[!NOTE|label:references:]

  • check status
    :checkhealth
    

config.lua

[!NOTE|label:references:]

$ cat ~/.config/nvim/lua/config.lua
lua require('config')

standard-path

[!NOTE|label:references:]

  • :help standard-path
  • XDG Base Directory Specification
  • get data
    :echo stdpath("xxx")
    
    " i.e.:
    :echo stdpath('config')
    /Users/marslo/.config/nvim
    
  • using in init.lua
    -- ~/.config/nvim/init.lua
    -- to setup undodir to `$HOME/.config/nvim/undo`. debug via `:verbose set undodir`
    vim.opt.undodir = vim.fn.stdpath('config') .. '/undo'
    -- or specific path
    vim.opt.undodir = vim.fn.expand( '~/.vim/undo' )
    
NAME COMMAND LINUX/OSX WINDOWS
CONFIG DIRECTORY stdpath("config") $HOME/.config/nvim %LOCALAPPDATA%\nvim
DATA DIRECTORY stdpath("data") $HOME/.local/share/nvim %LOCALAPPDATA%\nvim-data
RUN DIRECTORY :echo stdpath('run') /tmp/nvim.user/xxx %TEMP%\nvim.user\xxx
STATE DIRECTORY stdpath("state") $HOME/.local/state/nvim %LOCALAPPDATA%\nvim-data
CACHE DIRECTORY stdpath("cache") $HOME/.cache/nvim %LOCALAPPDATA%\Temp\nvim
LOG FILE stdpath("log") $HOME/.local/state/nvim/log %LOCALAPPDATA%\nvim-data\log
ADDITIONAL CONFIGS DIRECTORY stdpath("config_dirs") ['/etc/xdg/nvim'] -
ADDITIONAL DATA DIRECTORY stdpath("data_dirs") ['/usr/local/share/nvim', '/usr/share/nvim'] -
" config path
:lua print(vim.fn.stdpath('config'))
/Users/marslo/.config/nvim
:echo stdpath('config')
/Users/marslo/.config/nvim

" runtimepath
:lua print(vim.o.runtimepath)
:lua for _, path in ipairs(vim.split(vim.o.runtimepath, ',')) do print(path) end
:echo &runtimepath
:set runtimepath?
:echo split(&runtimepath, ',')

" package path
:lua print(vim.o.packpath)
:echo &packpath
:set packpath?

" rumtime
:lua print(vim.env.VIMRUNTIME)
:echo $VIMRUNTIME

" data dir
:lua vim.print(vim.fn.stdpath('data_dirs'))
:echo stdpath("data_dirs")

" config dir
:lua vim.print(vim.fn.stdpath('config_dirs'))
:echo stdpath("config_dirs")

" log
:lua print(vim.fn.stdpath('log'))
:echo stdpath('log')
:echo $NVIM_LOG_FILE

list parser paths

:lua for _, path in ipairs(vim.api.nvim_get_runtime_file('parser/*.so', true)) do print(path) end
/Users/marslo/.vim/plugged/nvim-treesitter/parser/awk.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/bash.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/c.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/cmake.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/css.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/diff.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/dockerfile.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/gitcommit.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/gitignore.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/git_config.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/git_rebase.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/groovy.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/html.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/ini.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/java.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/jq.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/json.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/lua.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/markdown.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/php.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/properties.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/python.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/query.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/ruby.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/ssh_config.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/toml.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/vim.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/vimdoc.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/xml.so
/Users/marslo/.vim/plugged/nvim-treesitter/parser/yaml.so
/opt/homebrew/Cellar/neovim/HEAD-43f3c4a/lib/nvim/parser/c.so
/opt/homebrew/Cellar/neovim/HEAD-43f3c4a/lib/nvim/parser/lua.so
/opt/homebrew/Cellar/neovim/HEAD-43f3c4a/lib/nvim/parser/markdown.so
/opt/homebrew/Cellar/neovim/HEAD-43f3c4a/lib/nvim/parser/markdown_inline.so
/opt/homebrew/Cellar/neovim/HEAD-43f3c4a/lib/nvim/parser/query.so
/opt/homebrew/Cellar/neovim/HEAD-43f3c4a/lib/nvim/parser/vim.so
/opt/homebrew/Cellar/neovim/HEAD-43f3c4a/lib/nvim/parser/vimdoc.so

:echo nvim_get_runtime_file('parser/*.so', v:true)
['/Users/marslo/.vim/plugged/nvim-treesitter/parser/bash.so', '/Users/marslo/.vim/plugged/nvim-treesitt
er/parser/c.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parser/cmake.so', '/Users/marslo/.vim/plug
ged/nvim-treesitter/parser/css.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parser/diff.so', '/User
s/marslo/.vim/plugged/nvim-treesitter/parser/dockerfile.so', '/Users/marslo/.vim/plugged/nvim-treesitte
r/parser/gitcommit.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parser/gitignore.so', '/Users/marsl
o/.vim/plugged/nvim-treesitter/parser/git_config.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parse
r/groovy.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parser/ini.so', '/Users/marslo/.vim/plugged/n
vim-treesitter/parser/java.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parser/jq.so', '/Users/mars
lo/.vim/plugged/nvim-treesitter/parser/json.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parser/lua
.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parser/markdown.so', '/Users/marslo/.vim/plugged/nvim
-treesitter/parser/python.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parser/query.so', '/Users/ma
rslo/.vim/plugged/nvim-treesitter/parser/ssh_config.so', '/Users/marslo/.vim/plugged/nvim-treesitter/pa
rser/vim.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parser/vimdoc.so', '/Users/marslo/.vim/plugge
d/nvim-treesitter/parser/xml.so', '/Users/marslo/.vim/plugged/nvim-treesitter/parser/yaml.so', '/usr/lo
cal/Caskroom/neovim-nightly/latest/nvim-macos-x86_64/lib/nvim/parser/c.so', '/usr/local/Caskroom/neovim
-nightly/latest/nvim-macos-x86_64/lib/nvim/parser/lua.so', '/usr/local/Caskroom/neovim-nightly/latest/n
vim-macos-x86_64/lib/nvim/parser/markdown.so', '/usr/local/Caskroom/neovim-nightly/latest/nvim-macos-x8
6_64/lib/nvim/parser/markdown_inline.so', '/usr/local/Caskroom/neovim-nightly/latest/nvim-macos-x86_64/
lib/nvim/parser/query.so', '/usr/local/Caskroom/neovim-nightly/latest/nvim-macos-x86_64/lib/nvim/parser
/vim.so', '/usr/local/Caskroom/neovim-nightly/latest/nvim-macos-x86_64/lib/nvim/parser/vimdoc.so']

lua

[!NOTE|label:references]

lua-intro

:lua vim.print(package.loaded)

lua-commands

[!TIP] lua version in nvim is not using local lua version

:lua print(_VERSION)
Lua 5.1

:lua =jit.version
LuaJIT 2.1.1703358377

:lua print(package.cpath)
./?.so;/usr/local/lib/lua/5.1/?.so;/opt/homebrew/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so

" local lua version
$ lua -v
Lua 5.4.7  Copyright (C) 1994-2024 Lua.org, PUC-Rio

tiktoken_core missing

[!TIP]

  1. matches to lua version inside nvim, not the system lua version
    :lua print(_VERSION)
    Lua 5.1
    
  2. using so instead of dylib
    :lua print(package.cpath)
    ./?.so;/usr/local/lib/lua/5.1/?.so;/opt/homebrew/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so
    
$ VERSION=$(curl --silent 'https://api.github.com/repos/gptlang/lua-tiktoken/releases/latest' | jq -r .tag_name)
$ curl -fsSL --create-dirs -o ~/.config/nvim/lua/tiktoken_core.dylib \
       https://github.com/gptlang/lua-tiktoken/releases/download/${VERSION}/tiktoken_core-macOS-arm64-lua51.dylib
$ ln -sf ~/.config/nvim/lua/tiktoken_core.dylib ~/.config/nvim/lua/tiktoken_core.so

$ echo 'require('tiktoken_core')' >> ~/.config/nvim/init.lua
:lua print(require('tiktoken_core'))
table: 0x010090a190

:lua =require("tiktoken_core")
{
  encode = <function 1>,
  new = <function 2>
}
$ nm -gU ~/.config/nvim/lua/tiktoken_core.dylib | grep luaopen
000000000000a314 T _luaopen_tiktoken_core

api info

:lua vim.print(vim.fn.api_info())
{
  error_types = {
    Exception = {
      id = 0
    },
    Validation = {
      id = 1
    }
  },
  ...
}

Tips

true color

[!NOTE|label:references:]

:echo &termguicolors
1
$ echo $TERM $COLORTERM
xterm-256color truecolor
  • force 16 colors
    $ TERM= COLORTERM= nvim
    

config path

[!NOTE]

  • SYNTAX FILES: ~/.config/nvim/syntax
  • ruby : ~/.config/nvim/ruby

tips

run Nvim without creating any directories or data files

$ NVIM_LOG_FILE=/dev/null nvim -n -i NONE

various commands

Copyright © marslo 2020-2024 all right reserved,powered by GitbookLast Modified: 2025-05-06 14:41:43

results matching ""

    No results matching ""