Update vimrc

This commit is contained in:
Rob Watson 2021-03-24 15:19:54 +01:00
parent 4a2dcce7b2
commit 82b65be3e2
2 changed files with 14 additions and 17 deletions

View File

@ -24,10 +24,8 @@ nnoremap <silent> ds :GoDebugStep<cr>
" Vim-Go configuration " Vim-Go configuration
let g:go_gopls_enabled = 0 let g:go_gopls_enabled = 0
let g:go_def_mapping_enabled = 0
let g:go_fmt_autosave = 0 let g:go_fmt_autosave = 0
" TODO: move to vim-lsp let g:go_imports_autosave = 0
let g:go_imports_autosave = 1
let g:go_auto_sameids = 0 let g:go_auto_sameids = 0
let g:go_auto_type_info = 0 let g:go_auto_type_info = 0
let g:go_code_completion_enabled = 0 let g:go_code_completion_enabled = 0

27
vimrc
View File

@ -96,12 +96,10 @@ augroup vimrc
autocmd FileType qf if (getwininfo(win_getid())[0].loclist != 1) | wincmd J | endif autocmd FileType qf if (getwininfo(win_getid())[0].loclist != 1) | wincmd J | endif
augroup end 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 set viewoptions-=curdir
" Key mappings: " Key mappings:
nmap <silent> <leader>/ :nohlsearch<CR>
nmap <silent> <leader><space> :nohlsearch<CR>
nnoremap j gj nnoremap j gj
nnoremap k gk nnoremap k gk
map <up> <nop> map <up> <nop>
@ -115,17 +113,18 @@ imap <right> <nop>
nmap ]q :cn<cr> nmap ]q :cn<cr>
nmap [q :cp<cr> nmap [q :cp<cr>
nnoremap <silent> ,/ :nohlsearch<cr> nnoremap <silent> <leader><space> :nohlsearch<cr>
map <c-t> <esc>:tabnew<cr>
" Select just-pasted text: " Select just-pasted text:
nnoremap <silent> <leader>0 `[v`] nnoremap <silent> <leader>0 `[v`]
nnoremap <silent> <leader>1 :set relativenumber!<cr> nnoremap <silent> <leader>1 :set relativenumber!<cr>
map <leader>m :marks<cr> nnoremap <leader>m :marks<cr>
map <leader>R :ALERename<cr> nnoremap <leader>v :vsplit<cr>
map <leader>v :vsplit<cr> nnoremap <leader>s :split<cr>
map <leader>s :split<cr> " <leader>a* currently conflicts with LspCodeAction
map <leader>ab :Gblame<cr> nnoremap <leader>ab :Gblame<cr>
map <leader>as :Gstatus<cr> nnoremap <leader>as :Gstatus<cr>
nnoremap <leader>ac :Commits<cr>
nnoremap <leader>ah :GitGutterLineHighlightsToggle<cr>
" yank filename of current buffer: " yank filename of current buffer:
nmap <leader>f :let @" = expand("%")<cr> nmap <leader>f :let @" = expand("%")<cr>
" and into + register: " 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_complete_delay', 25)
call deoplete#custom#option('auto_refresh_delay', 50) call deoplete#custom#option('auto_refresh_delay', 50)
call deoplete#custom#option('refresh_always', v:false) call deoplete#custom#option('refresh_always', v:false)
call deoplete#custom#option('prev_completion_mode', 'length')
call deoplete#custom#option('omni_patterns', { call deoplete#custom#option('omni_patterns', {
\ 'go': '[^. *\t]\.\w*', \ 'go': '[^. *\t]\.\w*',
\}) \})
@ -232,7 +230,6 @@ let g:lightline = {
" vim-gitgutter configuration " vim-gitgutter configuration
packadd! vim-gitgutter packadd! vim-gitgutter
set signcolumn=yes set signcolumn=yes
nnoremap hg :GitGutterLineHighlightsToggle<cr>
nmap ]h <Plug>(GitGutterNextHunk) nmap ]h <Plug>(GitGutterNextHunk)
nmap [h <Plug>(GitGutterPrevHunk) nmap [h <Plug>(GitGutterPrevHunk)
omap ih <Plug>(GitGutterTextObjectInnerPending) omap ih <Plug>(GitGutterTextObjectInnerPending)
@ -255,6 +252,8 @@ packadd! echodoc.vim
packadd! vim-fugitive packadd! vim-fugitive
" vim-go " 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 " load before LSP to ensure it doesn't clobber mappings
packadd! vim-go packadd! vim-go
@ -331,7 +330,7 @@ augroup lsp_install
au! au!
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
autocmd User lsp_diagnostics_updated call lightline#update() autocmd User lsp_diagnostics_updated call lightline#update()
" autocmd BufWritePre <buffer> silent LspDocumentFormatSync autocmd BufWritePre *.go silent LspDocumentFormatSync
" autocmd CursorHold <buffer> silent LspHover " autocmd CursorHold <buffer> silent LspHover
augroup END augroup END