1
0
mirror of https://github.com/luzifer/vim.git synced 2024-09-19 11:02:55 +00:00

Use a wrapper for goimports and gofmt

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-10-17 00:23:25 +02:00
parent 30bdd64e93
commit d801ac8b9d
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E
2 changed files with 11 additions and 1 deletions

10
bin/gofmtimport Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
set -euxo pipefail
[ ${DEBUG:-0} -eq 1 ] && exec 2>/tmp/gofmtimport.dbg
goimports \
-srcdir "$2" \
-local "${GOIMPORT_LOCAL:-}" \
-w "$2"
gofmt -s -w "$2"

2
vimrc
View File

@ -961,7 +961,7 @@ hi SignColumn cterm=none ctermbg=none
"
" Use goimports for Fmt
"
let g:go_fmt_command = "goimports"
let g:go_fmt_command = expand("~/.vim/bin/gofmtimport")
"
" filetype (common for plugins)