mirror of
https://github.com/luzifer/vim.git
synced 2024-12-20 10:21:19 +00:00
Use a wrapper for goimports and gofmt
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
30bdd64e93
commit
d801ac8b9d
2 changed files with 11 additions and 1 deletions
10
bin/gofmtimport
Executable file
10
bin/gofmtimport
Executable 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
2
vimrc
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue