[!NOTE|label:issue with wget certificate]
macOS versions less than 10.10
Copy $ brew install curl-ca-bundle
$ echo CA_CERTIFICATE= $( brew --prefix curl-ca-bundle ) /share/ca-bundle.crt >> ~/.wgetrc
Copy # 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
Copy # 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
Copy $ /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
Copy # 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
$ 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
Copy $ sudo cmake --build build/ --target uninstall
Copy # osx
$ brew install nvim
# nvim nightly
$ brew install --HEAD utf8proc
$ 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
Copy $ 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
Copy $ python3 -m pip install --user --upgrade pynvim
$ gem install neovim
$ npm install -g neovim
[!NOTE|label:references:]
Copy $ cat ~/.config/nvim/lua/config.lua
lua require ( 'config' )
[!NOTE|label:references:]
get data
Copy : echo stdpath ( "xxx" )
" i.e.:
: echo stdpath ( 'config' )
/Users/ marslo /.config/ nvim
using in init.lua
Copy -- ~ /.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' )
Copy : 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 ']
Copy :lua vim.print (package.loaded)
Copy :lua print (_VERSION)
Lua 5 . 1
:lua = jit.version
LuaJIT 2 . 1 . 1703358377
Copy $ echo $TERM $COLORTERM
xterm-256color truecolor
Copy : echo abs ( 1 . 456 )
1 . 456
: echo abs (- 5 . 456 )
5 . 456
: echo acos ( 0 )
1 . 570796
: echo acos (- 0 . 5 )
2 . 094395
: echo asin ( 0 . 8 )
0 . 927295
: echo asin (- 0 . 5 )
- 0 . 523599
: echo cosh ( 0 . 5 )
1 . 127626
: echo cosh (- 0 . 5 )
1 . 127626
" exponential
: echo exp ( 2 )
7 . 389056
: echo exp (- 1 )
0 . 367879
" x/y
: echo fmod ( 12 . 33 , 1 . 22 )
0 . 13
" smallest integral value greater than or equal to {expr} as a Float
: echo ceil ( 1 . 456 )
2 . 0
: echo ceil (- 5 . 456 )
- 5 . 0
" largest integral value less than or equal to
: echo floor ( 1 . 856 )
1 . 0
: echo floor (- 5 . 456 )
- 6 . 0
Copy : echo assert_equal ( 'foo' , 'bar' )
1
: echo assert_match ( '^f.*o$' , 'foobar' )
1
Copy : echo blob2list (0z0102. 0304 )
[ 1 , 2 , 3 , 4 ]
: echo blob2list (0z)
[]