Neovim安装
Neovim应该算是Vim的一个衍生版本或类似插件吧,从github两万多的star数可以看出其火爆程度。貌似提升性能和增加功能的同时也兼容了Vim。安装来体验一下。
Neovim安装教程地址在这。
Mac下直接:
brew install neovim
命令行启动命令:
nvim
查看帮助文档:
:help nvim
初始化Neovim,直接使用之前Vim的配置和插件目录:
To start the transition, create ~/.config/nvim/init.vim with these contents:
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
这样便安装和配置完毕了。
检查Neovim的「健康状况」:
:checkhealth
配置Python2和Python3的路径,尤其是系统上有多个Python环境或版本时:
vimrc中添加Python路径:
let g:python_host_prog = '/Users/test/anaconda2/bin/python'
let g:python3_host_prog = '/usr/local/bin/python3'
具体查看:help provider-python文档
同时启用Python支持:
sudo pip install neovim
sudo pip3 install neovim
Neovim可以配合Ruby和Node使用,需要使用到的话可以安装支持:
Ruby:
sudo gem install neovim
Node:
npm install -g neovim
Mac原来上的Node版本是5.7.1,报错了,使用nvm换成最新的lts版本:
nvm install --lts
nvm alias default 8.9.4
走完以上步骤checkhealth的结果正常应该是类似下面的:
health#nvim#check
========================================================================
## Configuration
- OK: no issues found
## Performance
- OK: Build type: Release
## Remote Plugins
- OK: Up to date
## terminal
- INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
- INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
- INFO: $XTERM_VERSION=''
- INFO: $VTE_VERSION=''
- INFO: $COLORTERM=''
- INFO: $SSH_TTY=''
health#provider#check
========================================================================
## Clipboard (optional)
- OK: Clipboard tool found: pbcopy
## Python 2 provider (optional)
- INFO: Using: g:python_host_prog = "/Users/test/anaconda2/bin/python"
- INFO: Executable: /Users/test/anaconda2/bin/python
- INFO: Python2 version: 2.7.9
- INFO: python-neovim version: 0.2.0
- OK: Latest python-neovim is installed: 0.2.0
## Python 3 provider (optional)
- INFO: Using: g:python3_host_prog = "/usr/local/bin/python3"
- INFO: Executable: /usr/local/bin/python3
- INFO: Python3 version: 3.6.4
- INFO: python3-neovim version: 0.2.0
- OK: Latest python3-neovim is installed: 0.2.0
## Ruby provider (optional)
- INFO: Ruby: ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
- INFO: Host: /usr/local/bin/neovim-ruby-host
- OK: Latest "neovim" gem is installed: 0.7.0
## Node provider (optional)
- INFO: Node: v8.9.4
- INFO: Host: /Users/test/.nvm/versions/node/v8.9.4/bin/neovim-node-host
- OK: Latest "neovim" npm is installed: 3.5.2
Ruby provider的检查可能出现连不了网络。
更多Neovim配置,可以参考: