[vim] set go fmt to sort local imports separately
This commit is contained in:
parent
eeb05bbab2
commit
d083cc1e94
1 changed files with 4 additions and 0 deletions
|
@ -308,6 +308,10 @@ if has("autocmd")
|
||||||
autocmd FileType go nmap <leader>f <Plug>(go-fmt)
|
autocmd FileType go nmap <leader>f <Plug>(go-fmt)
|
||||||
autocmd FileType go nmap <leader>d <Plug>(go-def)
|
autocmd FileType go nmap <leader>d <Plug>(go-def)
|
||||||
autocmd FileType go nmap <leader>m <Plug>(go-metalinter)
|
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
|
endif
|
||||||
|
|
||||||
nmap <space>w :cexpr [] \| cclose \| w<CR>
|
nmap <space>w :cexpr [] \| cclose \| w<CR>
|
||||||
|
|
Loading…
Add table
Reference in a new issue