gpt4 book ai didi

c++ - VIM YouCompleteMe 错误 - NoExtraConfDetected : No . 检测到 ycm_extra_conf.py 文件

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:18:19 39 4
gpt4 key购买 nike

我正在为 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 就在那里。

我是否将 let g:ycm_global_ycm_extra_conf = '$USER/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' 放置在 .vimrc 文件中?

最佳答案

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

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

关于c++ - VIM YouCompleteMe 错误 - NoExtraConfDetected : No . 检测到 ycm_extra_conf.py 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47812854/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com