I installed clang-complete
by using Vundle,and downloaded llvm using sudo apt install llvm-4.0
, downloaded clang by using sudo apt install libclang-4.0
.Here is my .vimrc:
let g:clang_complete_auto=1 " automatically complete after -> . ::
let g:clang_hl_errors=1 " highlight the warnings and error the same way clang does it
let g:clang_complete_copen=0 " open quickfix window on error
let g:clang_periodic_quickfix=0 " periodically update the quickfix window
let g:clang_snippets=0
let g:clang_close_preview=1
let g:clang_use_library=1
let g:clang_library_path='/usr/lib/llvm-4.0/lib'
let g:clang_user_options='-stdlib=libc++ -std=c++11 -I /usr/include/c++/8/'
set completeopt=menu,longest
However, it doesn't run well in this way. When I type std::
, the menu only shows some useless items such as size_t
but except cout
etc.