啟動vim打開文件時出錯:
The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). YCM core library compiled for Python 2 but loaded in Python 3. Set the 'g:ycm_server_pytho
n_interpreter' option to a Python 2 interpreter path.
原因:
參照官網github上的文檔編譯命令:cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp,
默認使用的是python2
解決方案:
關閉使用python2的默認行為,關閉宏USE_PYTHON2,如下:
cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir -DUSE_PYTHON2=OFF . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/
參考:
https://github.com/Valloric/YouCompleteMe#intro