我在 vim 中安装YouCompleteMe
插件,错误我退出 vim,我总是得到这样的错误:
Error detected while processing function <SNR>199_OnVimLeave:
line 1:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/roger/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 345, in OnVimLeave
self._ShutdownServer()
File "/Users/roger/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 208, in _ShutdownServer
SendShutdownRequest()
File "/Users/roger/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/shutdown_request.py", line 54, in SendShutdownRequest
request.Start()
File "/Users/roger/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/shutdown_request.py", line 42, in Start
TIMEOUT_SECONDS )
File "/Users/roger/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 81, in PostDataToHandler
timeout ) )
File "/Users/roger/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 180, in JsonFromFuture
response.raise_for_status()
File "/Users/roger/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/models.py", line 840, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://127.0.0.1:59577/shutdown%
这是我的YoucompleMe
配置:
NeoBundle 'Valloric/YouCompleteMe', {
\ 'build' : {
\ 'mac' : './install.py',
\ 'unix' : './install.py',
\ 'windows' : 'install.py',
\ 'cygwin' : './install.py'
\ }
\ }
let g:neobundle#install_process_timeout = 1500
"youcompleteme 默认tab s-tab 和自动补全冲突
let g:ycm_key_list_select_completion=['<c-n>']
let g:ycm_key_list_select_completion = ['<Down>']
let g:ycm_key_list_previous_completion=['<c-p>']
let g:ycm_key_list_previous_completion = ['<Up>']
let g:ycm_complete_in_comments = 1 "在注释输入中也能补全
let g:ycm_complete_in_strings = 1 "在字符串输入中也能补全
let g:ycm_use_ultisnips_completer = 1 "提示UltiSnips
let g:ycm_collect_identifiers_from_comments_and_strings = 1 "注释和字符串中的文字也会被收入补全
let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_server_keep_logfiles = 1
let g:ycm_server_use_vim_stdout = 1
let g:ycm_server_log_level = 'debug'
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
" 跳转到定义处, 分屏打开
let g:ycm_goto_buffer_command = 'horizontal-split'
nnoremap <leader>jd :YcmCompleter GoToDefinition<CR>
nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
nnoremap <leader>gd :YcmCompleter GoToDeclaration<CR>
let g:ycm_seed_identifiers_with_syntax=1 "语言关键字补全, 不过python关键字都很短,所以,需要的自己打开
" 引入,可以补全系统,以及python的第三方包 针对新老版本YCM做了兼容
" old version
if !empty(glob("~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py"))
let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py"
endif
" new version
if !empty(glob("~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"))
let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"
endif
" 直接触发自动补全 insert模式下
" let g:ycm_key_invoke_completion = '<C-Space>'
" 黑名单,不启用
let g:ycm_filetype_blacklist = {
\ 'tagbar' : 1,
\ 'gitcommit' : 1,
\}