This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 163
Neovim
VperuS edited this page Oct 6, 2018
·
12 revisions
Install LanguageClient-neovim using vim-plug
For vim user, the config file is ~/.vimrc
for neovim user, use ~/.config/nvim/init.vim
" LanguageClient-neovim
call plug#begin('~/.local/share/nvim/plugged')
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
" Multi-entry selection UI. FZF
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
call plug#end()
nvim +PlugInstall +UpdateRemotePlugins +qa
{
"initializationOptions": {
"cacheDirectory": "/tmp/cquery"
}
}
let g:LanguageClient_serverCommands = {
\ 'cpp': ['cquery', '--log-file=/tmp/cq.log'],
\ 'c': ['cquery', '--log-file=/tmp/cq.log'],
\ }
let g:LanguageClient_loadSettings = 1 " Use an absolute configuration path if you want system-wide settings
let g:LanguageClient_settingsPath = '/home/YOUR_USERNAME/.config/nvim/settings.json'
set completefunc=LanguageClient#complete
set formatexpr=LanguageClient_textDocument_rangeFormatting()
nnoremap <silent> gh :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> gr :call LanguageClient#textDocument_references()<CR>
nnoremap <silent> gs :call LanguageClient#textDocument_documentSymbol()<CR>
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
Produce compile_commands.json