Debian/Ubuntu编译安装Neovim

1、下载源码

  1. 首先安装git客户端

sudo apt install git 2. 从github上拉取源码 git clone https://github.com/neovim/neovim

2、安装必要的应用

  • Clang or GCC version 4.4+
  • CMake version 2.8.12+, built with TLS/SSL support
sudo apt-get install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip

3、编译

rm -r build/  # 清理 CMake cache
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/neovim" CMAKE_BUILD_TYPE=RelWithDebInfo #编译为带DebugInfo的Release
sudo make install #安装
export PATH="$HOME/neovim/bin:$PATH" #添加到环境变量

4、添加其他项

  1. 添加Python2/3支持
  • 安装python(一般自带)和pip
sudo apt install python python3 python-pip python3-pip
  • 添加pynvim
pip install pynvim
pip3 install pynvim
  1. 添加Yarn
  • 安装Yarn(不要直接使用debian自带源内的yarn)

添加yarn的源然后安装yarn

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
  • 添加neovim
yarn global add neovim

5、检查neovim的状况

在neovim下运行:checkhealth,全部安装完成后应该会显示如下图: debian-or-ubuntu-build-neovim-0.png

Some rights reserved
Except where otherwise noted, content on this page is licensed under a Creative Commons Attribution-ShareAlike 4.0 International license