1
0
Fork 0
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:
Knut Ahlers 2021-11-22 17:31:16 +01:00
parent c1d6e193b1
commit bb40c8c5ad
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D
2 changed files with 1 additions and 23 deletions

View file

@ -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"

View file

@ -911,11 +911,6 @@ let g:gitgutter_enabled = 1
let g:gitgutter_highlight_lines = 0 let g:gitgutter_highlight_lines = 0
hi SignColumn cterm=none ctermbg=none hi SignColumn cterm=none ctermbg=none
"
" Use goimports for Fmt
"
let g:go_fmt_command = expand("~/.config/nvim/bin/gofmtimport")
" "
" filetype (common for plugins) " filetype (common for plugins)
" "
@ -969,6 +964,7 @@ let g:go_def_mode = "gopls"
let g:go_fmt_autosave = 1 let g:go_fmt_autosave = 1
let g:go_fmt_command = "gopls" let g:go_fmt_command = "gopls"
let g:go_gopls_gofumpt = 1 let g:go_gopls_gofumpt = 1
let g:go_gopls_local = $GOIMPORT_LOCAL
let g:go_imports_autosave = 1 let g:go_imports_autosave = 1
let g:go_imports_mode = "gopls" let g:go_imports_mode = "gopls"
let g:go_metalinter_deadline = "20s" let g:go_metalinter_deadline = "20s"