From 82b65be3e28916fa6d036dbfbfee112e93d26d44 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Wed, 24 Mar 2021 15:19:54 +0100 Subject: [PATCH] Update vimrc --- vim/after/ftplugin/go.vim | 4 +--- vimrc | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/vim/after/ftplugin/go.vim b/vim/after/ftplugin/go.vim index 1f717ac..bf7dd53 100644 --- a/vim/after/ftplugin/go.vim +++ b/vim/after/ftplugin/go.vim @@ -24,10 +24,8 @@ 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 +let g:go_imports_autosave = 0 let g:go_auto_sameids = 0 let g:go_auto_type_info = 0 let g:go_code_completion_enabled = 0 diff --git a/vimrc b/vimrc index f48927b..8e19355 100644 --- a/vimrc +++ b/vimrc @@ -96,12 +96,10 @@ augroup vimrc autocmd FileType qf if (getwininfo(win_getid())[0].loclist != 1) | wincmd J | endif augroup end -" But, don't remember the current directory for a given file: +" Don't remember the current directory for a given file: set viewoptions-=curdir " Key mappings: -nmap / :nohlsearch -nmap :nohlsearch nnoremap j gj nnoremap k gk map @@ -115,17 +113,18 @@ imap nmap ]q :cn nmap [q :cp -nnoremap ,/ :nohlsearch -map :tabnew +nnoremap :nohlsearch " Select just-pasted text: nnoremap 0 `[v`] nnoremap 1 :set relativenumber! -map m :marks -map R :ALERename -map v :vsplit -map s :split -map ab :Gblame -map as :Gstatus +nnoremap m :marks +nnoremap v :vsplit +nnoremap s :split +" a* currently conflicts with LspCodeAction +nnoremap ab :Gblame +nnoremap as :Gstatus +nnoremap ac :Commits +nnoremap ah :GitGutterLineHighlightsToggle " yank filename of current buffer: nmap f :let @" = expand("%") " and into + register: @@ -151,7 +150,6 @@ call deoplete#custom#option('max_list', 30) call deoplete#custom#option('auto_complete_delay', 25) call deoplete#custom#option('auto_refresh_delay', 50) call deoplete#custom#option('refresh_always', v:false) -call deoplete#custom#option('prev_completion_mode', 'length') call deoplete#custom#option('omni_patterns', { \ 'go': '[^. *\t]\.\w*', \}) @@ -232,7 +230,6 @@ let g:lightline = { " vim-gitgutter configuration packadd! vim-gitgutter set signcolumn=yes -nnoremap hg :GitGutterLineHighlightsToggle nmap ]h (GitGutterNextHunk) nmap [h (GitGutterPrevHunk) omap ih (GitGutterTextObjectInnerPending) @@ -255,6 +252,8 @@ packadd! echodoc.vim packadd! vim-fugitive " vim-go +" Doesn't work in after/ftplugin/go.vim: +let g:go_def_mapping_enabled = 0 " load before LSP to ensure it doesn't clobber mappings packadd! vim-go @@ -331,7 +330,7 @@ augroup lsp_install au! autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() autocmd User lsp_diagnostics_updated call lightline#update() - " autocmd BufWritePre silent LspDocumentFormatSync + autocmd BufWritePre *.go silent LspDocumentFormatSync " autocmd CursorHold silent LspHover augroup END