我想安装自动完成插件YouCompleteMe for Vim。
我按照https://github.com/Valloric/YouCompleteMe/blob/master/README.md#full-installation-guide
上安装指南的说明进行操作我选择了不支持C系列语言语义完成的简单选项。
执行
vim --version
返回
VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 19 2019 12:07:03)
macOS version
Included patches: 1-950
Compiled by Homebrew
Huge version with MacVim GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr -tag_any_white
+arabic +file_in_path -mouse_sysmouse -tcl
+autocmd +find_in_path +mouse_urxvt +termguicolors
+autochdir +float +mouse_xterm +terminal
-autoservername +folding +multi_byte +terminfo
+balloon_eval -footer +multi_lang +termresponse
+balloon_eval_term +fork() -mzscheme +textobjects
+browse +fullscreen +netbeans_intg +textprop
++builtin_terms -gettext +num64 +timers
+byte_offset -hangul_input +odbeditor +title
+channel +iconv +packages +toolbar
+cindent +insert_expand +path_extra +transparency
+clientserver +job +perl +user_commands
+clipboard +jumplist +persistent_undo +vartabs
+cmdline_compl +keymap +postscript +vertsplit
+cmdline_hist +lambda +printer +virtualedit
+cmdline_info +langmap +profile +visual
+comments +libcall -python +visualextra
+conceal +linebreak +python3 +viminfo
+cryptv +lispindent +quickfix +vreplace
+cscope +listcmds +reltime +wildignore
+cursorbind +localmap +rightleft +wildmenu
+cursorshape +lua +ruby +windows
+dialog_con_gui +menu +scrollbind +writebackup
+diff +mksession +signs -X11
+digraphs +modify_fname +smartindent -xfontset
+dnd +mouse +startuptime +xim
-ebcdic +mouseshape +statusline -xpm
+emacs_tags +mouse_dec -sun_workshop -xsmp
+eval -mouse_gpm +syntax -xterm_clipboard
+ex_extra -mouse_jsbterm +tag_binary -xterm_save
+extra_search +mouse_netterm +tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -L. -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lm -lncurses -liconv -framework AppKit -L/usr/local/opt/lua/lib -llua5.3 -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation -framework Ruby
我添加了一行
Plugin 'Valloric/YouCompleteMe'
在我的.vimrc之后,然后是Vim命令
:PluginInstall
执行无误。
如果我随后启动Vim,则会显示以下错误消息:
The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). Unexpected exit code -11. Type ':YcmToggleLogs ycmd_62275_stderr_menu0zqa.log' to check the logs.
此处提到的日志文件为空。有人知道这是什么问题吗?
我知道StackOverflow和Github上还有许多其他问题,涉及非常相似的问题。但是,由于我花了最后3个小时来仔细研究这些问题,并尝试使该插件正常运行而无法成功工作,如果将其标记为重复并对此表示感谢,我将感到非常高兴。
答案 0 :(得分:0)
https://valloric.github.io/YouCompleteMe/#faq
YCM不适用于我的Anaconda Python设置
Anaconda通常与YCM使用的预构建libclang不兼容,因此不受支持。解决此问题的推荐方法是运行/ path / to / real / python install.py(例如/ usr / bin / python install.py)。
如果要在Anaconda项目中完成,请将.ycm_extra_conf.py文件中的interpreter_path选项指向您的Anaconda Python的路径,例如。
def Settings(**kwargs):
return {
'interpreter_path': '/path/to/anaconda/python'
}
有关更多详细信息,请参见Python Semantic Completion section。