[vim] set go fmt to sort local imports separately

This commit is contained in:
Bruno Carlin 2020-07-04 00:04:38 +02:00
parent eeb05bbab2
commit d083cc1e94

View file

@ -308,6 +308,10 @@ if has("autocmd")
autocmd FileType go nmap <leader>f <Plug>(go-fmt)
autocmd FileType go nmap <leader>d <Plug>(go-def)
autocmd FileType go nmap <leader>m <Plug>(go-metalinter)
autocmd FileType go let b:go_fmt_options = {
\ 'goimports': '-local ' .
\ trim(system('cd '. shellescape(expand('%:h')) .' && go list -m;')),
\ }
endif
nmap <space>w :cexpr [] \| cclose \| w<CR>