NeoVim 是基於 Vim 的一個 fork 分支,它主要解決了 Vim8 之前版本中的異步執行、開發模式等問題,對 Vim 的兼容性很好。同時對 vim 的代碼進行了大量地清理和重構,去掉了對老舊系統的支持,添加了新的特性。
雖然 Vim8 后來也新增了異步執行等特性,在使用層面兩者差異不大,但是 NeoVim 開發更激進,新特性更多,架構也相對更合理。
安裝
pip3 install pynvim
yum -y install epel-release
curl -o /etc/yum.repos.d/dperson-neovim-epel-7.repo https://copr.fedorainfracloud.org/coprs/dperson/neovim/repo/epel-7/dperson-neovim-epel-7.repo
yum -y install neovim --enablerepo=epel
配置 $HOME/.bashrc
。先配置 nvim 的別名為 vi,當執行 vi 時,Linux系統就會默認調用 nvim
tee -a $HOME/.bashrc <<'EOF'
# Configure for nvim
export EDITOR=nvim # 默認的編輯器(git 會用到)
alias vi="nvim"
EOF
檢查版本號
bash
vi --version