Post

Neovim安装备忘

以下均在Ubuntu 22.04进行。

Prerequisites

1
sudo apt-get install ninja-build gettext cmake unzip curl

git clone Neovim repo

1
2
git clone https://github.com/neovim/neovim\
cd neovim
1
2
3
4
5
# Optional stable version
# git checkout stable

# Optional download & build 3rd-party dependencies
# make deps

Download & build,Release/RelWithDebInfo/Debug

1
make CMAKE_BUILD_TYPE=Release

Check type

1
./build/bin/nvim --version | grep ^Build

Global installation into /usr/local

1
sudo make install

Or a specific location

1
make CMAKE_INSTALL_PREFIX=$HOME/local/nvim install

For updating, run the following commands and repeat the above (not verified)

1
make distclean

For uninstallation, run the follwing

1
2
make distclean\
sudo make uninstall

另:Linux根目录的/usr目录意思是Unix System Resources,一般安装预装软件。 用户软件一般安装在$HOME,为所有用户安装位置在/usr/local(即上)。

又另:/sbin的意思是“super users才能用的/bin

This post is licensed under CC BY 4.0 by the author.