Go home and put on the archlinux, the whim of a spacevim write a question
Installation configuration It's not too much of a problem to say.
Finally, the following questions appear when writing a question
Error while trying to load a compilation database:Could not auto-detect compilation database for file "poj-1458.cpp"No compilation database found in /home/tanglizi/Code/acm/summerTraining/2018 or any parent directoryfixed-compilation-database: Error while opening fixed database: No such file or directoryjson-compilation-database: Error while opening JSON database: No such file or directoryRunning without flags.
Check Google, found that this is clang-check problem, Clang-check need a Compile_commands.json file (can be generated by CMake) to do engineering check
Then the problem is solved.
Method One
Uninstall the clang and replace the GCC
The absolute violence of the method, can say very not elegant
Method Two
Handwritten compile_commands.json files, or cmake a project
But to the ACM Brush Question party, this is really inconvenient
Method Three
Immediately abandoned the first two methods, so began to modify the Vim plugin
Or check Google, found that the problem is a name Neomake plug-in
So find the file about Clang-check and see how it calls Clang-check's
grep clang-check -R ~/.cache/vimfiles/repos/github.com# /home/tanglizi/.cache/vimfiles/repos/github.com/neomake/neomake/autoload/neomake/makers/ft/c.vim: " ‘exe‘: ‘clang-check‘vim /home/tanglizi/.cache/vimfiles/repos/github.com/neomake/neomake/autoload/neomake/makers/ft/c.vim
You can see that line 32nd appears Clang-check
function! neomake#makers#ft#c#clangcheck() abort return { \ ‘exe‘: ‘clang-check‘, \ ‘args‘: [‘%:p‘], \ ‘errorformat‘: \ ‘%-G%f:%s:,‘ . \ ‘%f:%l:%c: %trror: %m,‘ . \ ‘%f:%l:%c: %tarning: %m,‘ . \ ‘%I%f:%l:%c: note: %m,‘ . \ ‘%f:%l:%c: %m,‘. \ ‘%f:%l: %trror: %m,‘. \ ‘%f:%l: %tarning: %m,‘. \ ‘%I%f:%l: note: %m,‘. \ ‘%f:%l: %m‘, \ }endfunction
So in the 33 line of args add '--', the same treatment Clang-tidy (75 lines), it's done.
\ ‘args‘: [‘%:p‘, ‘--‘],
The idea is to add '--' after the original command, Clang will not find compilation database.
clang-check file.cpp --
Spacevim Neomake Error Error while trying to load a compilation database