From eae0e7044ceff95f34ba4cf54447d936daea3f2e Mon Sep 17 00:00:00 2001 From: chxuan <787280310@qq.com> Date: Sat, 31 Aug 2019 16:35:55 +0800 Subject: [PATCH] use python2.7 --- .vimrc | 2 +- README.md | 4 ---- install.sh | 6 +++--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.vimrc b/.vimrc index 38a857f..4923b46 100644 --- a/.vimrc +++ b/.vimrc @@ -248,7 +248,7 @@ let g:ycm_warning_symbol = '✹' let g:ycm_seed_identifiers_with_syntax = 1 let g:ycm_complete_in_comments = 1 let g:ycm_complete_in_strings = 1 -let g:ycm_server_python_interpreter = '/usr/bin/python' +let g:ycm_server_python_interpreter = '/usr/bin/python2.7' let g:ycm_python_binary_path = 'python' nnoremap u :YcmCompleter GoToDeclaration " 已经使用cpp-mode插件提供的转到函数实现的功能 diff --git a/README.md b/README.md index 1d07c92..0ad9240 100644 --- a/README.md +++ b/README.md @@ -170,10 +170,6 @@ An automatic configuration program for vim vimplus使用vim-plug作为插件管理器,vim-plug可能由于界面没有刷新(其实在安装),所以进度一直停留在`Installing plugins (24/40)`,用户只需要耐心等待所有插件安装完成即可,或者直接`Ctrl+C`终止安装,通过vim打开`~/.vimrc`并执行`:PlugInstall`命令安装剩余插件。 -- **`The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). YCM core library compiled for Python 3 but loaded in Python 2. Set the 'g:ycm_server_python_interpreter' option to a Python 3 interpreter path`** - - 编译ycm和运行ycmd server的python版本不一致导致的,比如说,编译ycm时使用系统默认版本python3,后来又将系统默认版本改为python2,解决该问题有三种方法,第一:编辑.vimrc,将g:ycm_server_python_interpreter指向编译ycm时的python版本,第二:使用当前python版本重新编译ycm,第三:恢复系统默认的python版本。 - - **`vimplus不支持目前用户正在使用的系统怎么办?`** 可以给作者提[Issues][39],或者自己fork vimplus来修改,并提交pr,贡献自己的一份力量。 diff --git a/install.sh b/install.sh index c0bd560..eb14818 100755 --- a/install.sh +++ b/install.sh @@ -245,14 +245,14 @@ function install_ycm_on_linux() git clone https://gitee.com/chxuan/YouCompleteMe_linux_with_clang.git ~/.vim/plugged/YouCompleteMe cd ~/.vim/plugged/YouCompleteMe - ./install.py --clang-completer + python2.7 ./install.py --clang-completer } # macos编译ycm, 原始方法 function compile_ycm_on_mac_legacy() { cd ~/.vim/plugged/YouCompleteMe - ./install.py --clang-completer --system-libclang + python2.7 ./install.py --clang-completer --system-libclang } # macos编译ycm, Mojave上的方法 @@ -262,7 +262,7 @@ function compile_ycm_on_mac_mojave() xcode-select --install open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg cd ~/.vim/plugged/YouCompleteMe - ./install.py --clang-completer + python2.7 ./install.py --clang-completer } # 在MacOS上安装ycm插件