step0、参考:language servers used with YCM
step1、安装依赖
安装时 | node.js、npm |
运行时 | node.js |
step2、创建~/.lsp/vim-language-server
目录
mkdir -p ~/.lsp/vim-language-server
step3、进入~/.lsp/vim-language-server
目录
cd ~/.lsp/vim-language-server
step4、使用npm安装vim-language-server
npm install vim-language-server
step5、在~/.vimrc
中加入如下的配置
let g:ycm_language_server = [
\{ 'name': 'vim',
\ 'filetypes': [ 'vim' ],
\ 'cmdline': [ 'node', expand( '$HOME/.lsp/vim-language-server/node_modules/.bin/vim-language-server' ), '--stdio' ],
\}
]