This is my .vimrc:
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'Valloric/YouCompleteMe'
Plugin 'jnurmine/Zenburn'
Plugin 'ldx/vim-indentfinder'
call vundle#end()
filetype plugin indent on
colors zenburn
set encoding=utf-8
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
set number
let g:ycm_always_populate_location_list = 1
Now, I am trying to use it in a C++ project. The thing is that the compilation errors are not highlighted inside the editor. I know my .ycm_extra_conf.py
good and well configured, because if run:
:YcmForceCompileAndDiagnostics
and then, in a line I know to be wrong:
:YcmShowDetailedDiagnostic
I get the expected error message:
/home/lvella/src/project/src/main.cpp:56:2: error: unknown type name 'safdsadfsadf'
But it is not highlighted. By inspecting :YcmDiags
, I can see 30 warning messages originated from inside an external library I am using. Now I suspect that error list is filled with up to 30 entries, leaving the ones in my code out of it. Am I right? Can I filter out all the entries not present in the file I am currently looking at? Can I increase the number of entries listed? How to see my errors?
As it turned out, it was a matter of reading the manual:
The g:ycm_max_diagnostics_to_display option
This option controls the maximum number of diagnostics shown to the user when errors or warnings are detected in the file. This option is only relevant if you are using the C-family semantic completion engine.
Default: 30
let g:ycm_max_diagnostics_to_display = 30
I just set this option to 1000 and I could see my error messages.