VIM YouCompleteMe错误 - NoExtraConfDetected:未检测到.ycm_extra_conf.py文件

时间:2017-12-14 11:58:54

标签: c++ linux vim

我正在为C ++设置YouCompleteMe但是当我打开.cpp文件时,我收到错误NoExtraConfDetected:检测到没有.ycm_extra_conf.py文件

.vimrc文件如下所示:

set nocompatible " be iMproved, required filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required

Plugin 'VundleVim/Vundle.vim'

Plugin 'rdnetto/YCM-Generator'

Plugin 'Valloric/YouCompleteMe'
let g:ycm_global_ycm_extra_conf = '$USER/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'

" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required

我认为这一行:

let g:ycm_global_ycm_extra_conf = '$USER/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'

会处理错误。

我按照路径行进, .ycm_extra_conf.py 就在那里。

我是否让g:ycm_global_ycm_extra_conf =' $ USER / .vim / bundle / YouCompleteMe / third_party / ycmd / cpp / ycm / .ycm_extra_conf.py' 放错了.vimrc文件?

1 个答案:

答案 0 :(得分:0)

无法解释,但vimrc不喜欢$ USER,你需要一个la $ HOME的完整路径。试试这个:

让g:ycm_global_ycm_extra_conf =' /home/YOUR_USER/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'