diff --git a/vim/after/ftplugin/go.vim b/vim/after/ftplugin/go.vim index 4e41434..7822013 100644 --- a/vim/after/ftplugin/go.vim +++ b/vim/after/ftplugin/go.vim @@ -3,6 +3,31 @@ map i :GoImplements map ^ :GoAlternate map d :GoDoc +map gv :vsplit:GoAlternate! +map gs :split:GoAlternate! +map gt :w :GoTest +map gf :w :GoTestFunc + +nnoremap dr :GoDebugBreakpoint +nnoremap d! :GoDebugStart +nnoremap dc :GoDebugContinue +nnoremap dq :GoDebugStop +nnoremap dn :GoDebugNext +nnoremap ds :GoDebugStep + +" Vim-Go configuration: +let g:go_fmt_autosave = 0 +" Vim-Go seems to handle fix-on-save better than ALE: +let g:go_imports_autosave = 1 +let g:go_auto_sameids = 0 +let g:go_auto_type_info = 0 +let g:go_info_mode = "gopls" +let g:go_fmt_options = { + \ 'goimports': '-local github.com/sensiblecode.com/cantabular', + \ } +autocmd BufNewFile,BufRead *.gohtml set syntax=gohtmltmpl +autocmd BufNewFile,BufRead *.go nmap g6 :GoAlternate! + iabbrev fmtpl fmt.Println("")hi iabbrev fmtpf fmt.Printf("\n")3hi iabbrev mk make([]MyType, 0)9h diff --git a/vimrc b/vimrc index 87538f5..4fcd40e 100644 --- a/vimrc +++ b/vimrc @@ -60,7 +60,7 @@ set pastetoggle= " See :help thesaurus set thesaurus=$HOME/Documents/thesaurus/thesaurus_pkg/thesaurus.txt set pumheight=200 -set completeopt=menu,menuone,popup,longest,noselect,noinsert +set completeopt=menu,menuone,popup,longest,noselect set completepopup=width:300,height:50,align:item,border:off " Colour scheme: @@ -93,17 +93,9 @@ map m :marks map R :registers map v :vsplit map s :split -map gv :vsplit:GoAlternate -map gs :split:GoAlternate map ! :only " ctrl-c to unload a buffer nnoremap :bp\|bd # -nnoremap dr :GoDebugBreakpoint -nnoremap d! :GoDebugStart -nnoremap dc :GoDebugContinue -nnoremap dq :GoDebugStop -nnoremap dn :GoDebugNext -nnoremap ds :GoDebugStep function! ToggleQuickFix() if empty(filter(getwininfo(), 'v:val.quickfix')) @@ -132,9 +124,10 @@ packadd! deoplete.nvim let g:deoplete#enable_at_startup = 1 call deoplete#custom#option('num_processes', 6) " https://github.com/Shougo/deoplete.nvim/issues/965#issuecomment-482925193 -call deoplete#custom#option('omni_patterns', { -\ 'go': '[^. *\t]\.\w*', -\}) +" Seems to be causing autocomplete issues so removing for now. +" call deoplete#custom#option('omni_patterns', { +" \ 'go': '[^. *\t]\.\w*', +" \}) " : completion. inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" @@ -158,16 +151,6 @@ packadd! command-t " Lightline configuration: set laststatus=2 -" Vim-Go configuration: -let g:go_fmt_autosave = 0 -" Vim-Go seems to handle fix-on-save better than ALE: -let g:go_imports_autosave = 1 -let g:go_fmt_options = { - \ 'goimports': '-local github.com/sensiblecode.com/cantabular', - \ } -autocmd BufNewFile,BufRead *.gohtml set syntax=gohtmltmpl -autocmd BufNewFile,BufRead *.go nmap g6 :GoAlternate! - " Vim-Rust configuration: let g:rustfmt_autosave = 1