Skip to content
Zheng Luo edited this page Dec 11, 2017 · 14 revisions

CQuery is a Low-latency language server for large C++ code-bases, powered by libclang.

Building

See https://github.com/jacobdufault/cquery#build-cquery

Configuration

let g:LanguageClient_serverCommands = {
\ 'cpp': ['yourCQueryDirectory/build/app', '--language-server']                                                                                                                                                                              
\ }
let g:LanguageClient_loadSettings = 1
" Use an absolute configuration path if you want system-wide settings
" let g:LanguageClient_settingsPath = '/home/yourusername/.config/nvim/settings.json'

Workspace configuration

Add in your project a file under .vim/settings.json with this content

{
        "initializationOptions": {
                "cacheDirectory": "/tmp/cquery",
		"resourceDirectory": "/absolute/path/yourCQueryDirectory/clang_resource_dir"
        }
}

Change cacheDirectory according to your needs

Use with deoplete

Make sure you have installed the latest versions of deoplete (after cbcdf10-20171203) and LanguageClient-neovim (after https://github.com/autozimu/LanguageClient-neovim/pull/193 is merged).

Also install Neosnippet and configure:

imap <C-k>     <Plug>(neosnippet_expand_or_jump)
smap <C-k>     <Plug>(neosnippet_expand_or_jump)
xmap <C-k>     <Plug>(neosnippet_expand_target)

to your kepmappings. After that you may invoke <C-k> to expand and iterate over a completion item.

Clone this wiki locally