Configure LSP for C

This commit is contained in:
Julian Ospald 2018-06-12 17:47:09 +02:00
parent 35bdc2d2c1
commit d88d26e249
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 21 additions and 0 deletions

View File

@ -7,3 +7,19 @@ let g:ale_c_clangformat_options = '-style=file'
let g:ycm_goto_buffer_command = 'same-buffer'
nnoremap <F3> :call LanguageClient_contextMenu()<CR>
nnoremap <silent> <F4> :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <F7> :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> <F6> :call LanguageClient#textDocument_rename()<CR>
let g:LanguageClient_autoStart = 1
let g:LanguageClient_serverCommands = {
\ 'c': ['cquery', '--language-server', '--log-file=/tmp/cq.log'],
\ }
let g:LanguageClient_rootMarkers = {
\ 'c': ['.cquery', 'compile_commands.json', 'build'],
\ }
let g:LanguageClient_settingsPath = $HOME.'/.vim/cquery.json'

5
cquery.json Normal file
View File

@ -0,0 +1,5 @@
{
"initializationOptions": {
"cacheDirectory": "/tmp/cquery"
}
}