From 520d0150ed7139bb01d4853199701ad521c5bc04 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Mon, 22 Mar 2021 09:11:12 +0100 Subject: [PATCH] vimrc: further configuration --- vim/after/ftplugin/go.vim | 1 + vimrc | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/vim/after/ftplugin/go.vim b/vim/after/ftplugin/go.vim index c01737a..13abcbf 100644 --- a/vim/after/ftplugin/go.vim +++ b/vim/after/ftplugin/go.vim @@ -22,6 +22,7 @@ nnoremap ds :GoDebugStep " Vim-Go configuration let g:go_gopls_enabled = 0 +let g:go_def_mapping_enabled = 0 let g:go_fmt_autosave = 0 " TODO: move to vim-lsp let g:go_imports_autosave = 1 diff --git a/vimrc b/vimrc index 8dcc52a..306c0b5 100644 --- a/vimrc +++ b/vimrc @@ -119,7 +119,6 @@ map :tabnew " Select just-pasted text: nnoremap 0 `[v`] nnoremap 1 :set relativenumber! -nnoremap 2 :call SwitchBackground() map m :marks map R :ALERename map v :vsplit @@ -268,8 +267,12 @@ let g:lsp_settings = { \ 'unusedparams': v:true, \ 'unusedresult': v:true, \ 'shadow': v:true, + \ 'nilness': v:true, + \ 'unusedwrite': v:true, \ }, \ 'staticcheck': v:true, + \ 'hoverKind': 'SynopsisDocumentation', + \ 'linksInHover': v:false, \ }}} let g:lsp_diagnostics_float_cursor = 1 let g:lsp_diagnostics_float_delay = 200 @@ -280,9 +283,9 @@ let g:lsp_document_highlight_delay = 500 function! s:on_lsp_buffer_enabled() abort setlocal omnifunc=lsp#complete - setlocal signcolumn=yes " number may be clobbered by vim-fugitive? setlocal number + setlocal signcolumn=yes " Jump to definitions nmap gd (lsp-definition) @@ -314,6 +317,7 @@ function! s:on_lsp_buffer_enabled() abort nmap i (lsp-implementation) nmap r (lsp-references) nmap d (lsp-hover) + nmap o :LspCodeAction source.organizeImports nmap e (lsp-rename) endfunction