Try configuring Extra conf in vimrc. If you use vundle, that is: let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
If you use Vim-Plug, this is: let g:ycm_global_ycm_extra_conf = '~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
What editor did you install the vim plug-in on?
Try configuring Extra conf in vimrc.
If you use vundle, that is:
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
If you use Vim-Plug, this is:
let g:ycm_global_ycm_extra_conf = '~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
Just put
.ycm_extra_conf.py
文件放到~/
in the directory. Of course, @S1ngS1ng’s method is also possible.Use YCM-Generator to generate the .ycm_extra_conf.py file and put it in the directory where you open vim or set the default path in vimrc