From b94fa855e4ed01cdf1920b62ac790513832024b7 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Wed, 8 Sep 2021 10:44:18 +0800 Subject: [PATCH] feat: golang organize import on save --- cli/vim/init.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/vim/init.vim b/cli/vim/init.vim index 26433fc..20c681e 100644 --- a/cli/vim/init.vim +++ b/cli/vim/init.vim @@ -347,3 +347,7 @@ autocmd BufEnter,BufRead commitmsg.md :set colorcolumn=100 " nerdtree nnoremap t :NERDTreeToggle + +" go organize import on save +command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') +autocmd BufWritePre *.go :OR