vimrc: further configuration

This commit is contained in:
Rob Watson 2021-03-22 09:11:12 +01:00
parent f30270cec1
commit 520d0150ed
2 changed files with 7 additions and 2 deletions

View File

@ -22,6 +22,7 @@ nnoremap <silent> ds :GoDebugStep<cr>
" 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

8
vimrc
View File

@ -119,7 +119,6 @@ map <c-t> <esc>:tabnew<cr>
" Select just-pasted text:
nnoremap <silent> <leader>0 `[v`]
nnoremap <silent> <leader>1 :set relativenumber!<cr>
nnoremap <silent> <leader>2 :call SwitchBackground()<cr>
map <leader>m :marks<cr>
map <leader>R :ALERename<cr>
map <leader>v :vsplit<cr>
@ -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 <buffer> gd <plug>(lsp-definition)
@ -314,6 +317,7 @@ function! s:on_lsp_buffer_enabled() abort
nmap <buffer> <leader>i <plug>(lsp-implementation)
nmap <buffer> <leader>r <plug>(lsp-references)
nmap <buffer> <leader>d <plug>(lsp-hover)
nmap <buffer> <leader>o :LspCodeAction source.organizeImports<cr>
nmap <buffer> <leader>e <plug>(lsp-rename)
endfunction