summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-03-07 22:33:21 +0100
committerAdrian Kummerlaender2019-03-08 14:48:58 +0100
commit9e8120163c96544b52380e76c2a8d89c4f3fa381 (patch)
tree8dbd0f5b5608ffca96f905ca1f8f7ae4ad740a50
parente324de87dad9773f02d4da0aea64d1c394c2226f (diff)
downloadpkgs-9e8120163c96544b52380e76c2a8d89c4f3fa381.tar
pkgs-9e8120163c96544b52380e76c2a8d89c4f3fa381.tar.gz
pkgs-9e8120163c96544b52380e76c2a8d89c4f3fa381.tar.bz2
pkgs-9e8120163c96544b52380e76c2a8d89c4f3fa381.tar.xz
pkgs-9e8120163c96544b52380e76c2a8d89c4f3fa381.zip
Revert back to basic ctags navigation
LSP based navigation in a header-centric codebase turned out to be not that much better than plain ctags. The latter has the advantage of being both the most performant and most simple to setup. The main problem with e.g. cquery is that its underlying JSON compilation database only maintains information on compilation units i.e. cpp files. In this situation navigation in header files frequently reverts back to plain guessing which provides no advantage over ctags. Added vim-gutentags for automatic regeneration on file save.
-rw-r--r--pkgs/custom-neovim/asset/rc.vim46
-rw-r--r--pkgs/custom-neovim/default.nix2
-rw-r--r--pkgs/custom-neovim/plugins.nix18
3 files changed, 4 insertions, 62 deletions
diff --git a/pkgs/custom-neovim/asset/rc.vim b/pkgs/custom-neovim/asset/rc.vim
index 31eb27a..6675cce 100644
--- a/pkgs/custom-neovim/asset/rc.vim
+++ b/pkgs/custom-neovim/asset/rc.vim
@@ -36,8 +36,8 @@ let mapleader=","
map <leader>s :let @/=""<CR>
map <leader>c zz
-map <leader>d <c-]>
map <leader>h q:
+map <leader>d g<C-]>
nmap <backspace> :e#<CR>
nmap f za
@@ -123,45 +123,5 @@ let g:undotree_SetFocusWhenToggle = 1
let g:localvimrc_sandbox = 0
let g:localvimrc_persistent = 2
-let g:wordmotion_prefix = '<Leader>'
-nmap <S-w> <Leader>w
-
-let g:lsp_auto_enable = 0
-
-" spinning up a language client only makes
-" sense if such a client is available
-if executable('cquery')
- let g:lsp_auto_enable = 1
-
- autocmd User lsp_setup call lsp#register_server({
- \ 'name': 'cquery',
- \ 'cmd': {server_info->['cquery']},
- \ 'root_uri': {server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'compile_commands.json'))},
- \ 'initialization_options': { 'cacheDirectory': '/tmp/cquery' },
- \ 'whitelist': ['c', 'cpp', 'cc'],
- \ })
-
- nnoremap <silent> gd :LspDefinition<CR>
- nnoremap <silent> gt :LspTypeDefinition<CR>
- nnoremap <silent> gi :LspImplementation<CR>
- nnoremap <silent> gr :LspReferences<CR>
- nnoremap <c-t> :LspWorkspaceSymbol<CR>
- nnoremap <a-t> :LspDocumentSymbol<CR>
-
- autocmd FileType cpp setlocal omnifunc=lsp#complete
- set completeopt=longest,menuone,preview
- " use enter to select completion item
- inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
- " improve popup and selection behavior
- inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
- \ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
- inoremap <expr> <M-,> pumvisible() ? '<C-n>' :
- \ '<C-x><C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
- " trigger omnicompletion using <C-m> (compared to <C-n> for plain completion)
- inoremap <C-m> <C-x><C-o>
-
- " close documentation buffer after selecting a completion item
- autocmd CompleteDone * silent! pclose
- " close quickfix buffer after selection
- autocmd FileType qf nnoremap <buffer> <CR> <CR>:cclose<CR>
-endif
+let g:wordmotion_prefix = '<leader>'
+nmap <S-w> <leader>w
diff --git a/pkgs/custom-neovim/default.nix b/pkgs/custom-neovim/default.nix
index 1dff1f7..422847e 100644
--- a/pkgs/custom-neovim/default.nix
+++ b/pkgs/custom-neovim/default.nix
@@ -17,7 +17,7 @@ in pkgs.neovim.override {
# autocomplete
fzfWrapper
fzf-vim
- async vim-lsp
+ vim-gutentags
# load project specific config
vim-localvimrc
diff --git a/pkgs/custom-neovim/plugins.nix b/pkgs/custom-neovim/plugins.nix
index 5e0f6ea..9ff92f2 100644
--- a/pkgs/custom-neovim/plugins.nix
+++ b/pkgs/custom-neovim/plugins.nix
@@ -76,24 +76,6 @@ in {
};
};
- vim-lsp = buildVimPlugin {
- name = "vim-lsp";
- src = fetchgit {
- url = "https://github.com/prabirshrestha/vim-lsp.git";
- rev = "0310241af11adc6c3a7ba93955bc27b15744c957";
- sha256 = "0ccd6is75qlk8mg9wpwp1ypq68p7lgbq1c1jbpr6pwr59s53r4lx";
- };
- };
-
- async = buildVimPlugin {
- name = "async";
- src = fetchgit {
- url = "https://github.com/prabirshrestha/async.vim.git";
- rev = "f3014550d7a799097e56b094104dd2cd66cf2612";
- sha256 = "0zn25qwycynagrij5rsp1x7kbfz612gn7xda0hvm4y7qr3pal77p";
- };
- };
-
vim-color-akr = buildVimPlugin {
name = "vim-color-akr";
src = ./asset/vim-color-akr;