mirror of
https://github.com/luzifer/vim.git
synced 2024-11-09 16:10:00 +00:00
Fix import formatting not done properly
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c1d6e193b1
commit
bb40c8c5ad
2 changed files with 1 additions and 23 deletions
|
@ -1,18 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -euxo pipefail
|
||||
|
||||
[ ${DEBUG:-0} -eq 1 ] && exec 2>/tmp/gofmtimport.dbg
|
||||
|
||||
cmdimports=$(command -v gofumports || command -v goimports || true)
|
||||
cmdfmt=$(command -v gofumpt || command -v gofmt || true)
|
||||
|
||||
[[ -n $cmdimports ]] && [[ -n $cmdfmt ]] || {
|
||||
echo "No imports command or no fmt command found" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
${cmdimports} \
|
||||
-srcdir "$2" \
|
||||
-local "${GOIMPORT_LOCAL:-}" \
|
||||
-w "$2"
|
||||
${cmdfmt} -s -w "$2"
|
6
init.vim
6
init.vim
|
@ -911,11 +911,6 @@ let g:gitgutter_enabled = 1
|
|||
let g:gitgutter_highlight_lines = 0
|
||||
hi SignColumn cterm=none ctermbg=none
|
||||
|
||||
"
|
||||
" Use goimports for Fmt
|
||||
"
|
||||
let g:go_fmt_command = expand("~/.config/nvim/bin/gofmtimport")
|
||||
|
||||
"
|
||||
" filetype (common for plugins)
|
||||
"
|
||||
|
@ -969,6 +964,7 @@ let g:go_def_mode = "gopls"
|
|||
let g:go_fmt_autosave = 1
|
||||
let g:go_fmt_command = "gopls"
|
||||
let g:go_gopls_gofumpt = 1
|
||||
let g:go_gopls_local = $GOIMPORT_LOCAL
|
||||
let g:go_imports_autosave = 1
|
||||
let g:go_imports_mode = "gopls"
|
||||
let g:go_metalinter_deadline = "20s"
|
||||
|
|
Loading…
Reference in a new issue