0
votes

Following the official guide, I installed YouCompleteMe including semantic support with clangd completer. Did everything exactly as the guide says it (starting by cloning the project to .vim/bundle and the doing git submodule init).

For clangd flags, I found a .ycm_extra_conf.py in the directory ~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py

My full .vimrc file looks like:

set number
syntax on
filetype plugin indent on
set tabstop=4
set shiftwidth=4
expandtab

" YouCompleteMe settings
let g:ycm_clangd_binary_path="/usr/bin/clangd"
let g:ycm_global_ycm_extra_conf="/home/me/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py"
set runtimepath+=~/.vim/bundle/YouCompleteMe/plugin/youcompleteme.vim

Then I created a test.cpp file in my home directory and tried typing in some code, but the YouCompleteMe autocomplete is not working. I'm not seeing any suggestions at all.

EDIT: My clangd version is 9.0.1

EDIT 2: Appended .vim file path of the plugin to .vimrc. Still not working.

1
Is YouCompleteMe even loaded?Mateen Ulhaq
@MateenUlhaq Removed the :. I have a feeling that YouCompleteMe is not loaded. Is there anything I need to do to load it?kovac
The same as any other plugin. Depends on how you're installing the plugin. Are you using a plugin manager like vim-plug?Mateen Ulhaq
@MateenUlhaq No, I installed this manually using cmake.kovac
Hmmm... I don't personally use YCM so I'm not sure. You might get better answers from vi.stackexchange.com (you can flag this question for a moderator to migrate) or from YCM's Issue Tracker.Mateen Ulhaq

1 Answers

0
votes

So the problem was, I needed set runtimepath+=~/.vim/bundle/YouCompleteMe/ instead of set runtimepath+=~/.vim/bundle/YouCompleteMe/plugin/youcompleteme.vim and this line needed to go before the line filetype plugin indent on.