From befbbafb586c83b8edfbc586cdeda4dc5d982ed1 Mon Sep 17 00:00:00 2001 From: tdro Date: Wed, 2 Dec 2020 15:00:05 -0500 Subject: .vimrc: Add golang checks --- .vimrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 29d9214..fce994c 100644 --- a/.vimrc +++ b/.vimrc @@ -325,12 +325,14 @@ augroup AutoCommands autocmd FileType bash,sh autocmd! BufWritePost :call ShellCheck() autocmd FileType nix autocmd! BufWritePost silent call NixCheck() autocmd FileType elixir autocmd! BufWritePost :call ElixirFormat() - autocmd FileType awk autocmd! BufWritePost silent !notify-send "$(awk -g -f % 2>&1 && awk -o- -f % | sponge % && echo 'awk OK:' %)" autocmd FileType rust autocmd! BufWritePost silent !notify-send "$(rustfmt % 2>&1 && echo 'rustfmt OK:' %)" + autocmd FileType go autocmd! BufWritePost silent !notify-send "$(gofmt -w -s -e % 2>&1 && go vet % 2>&1 && echo 'gofmt OK:' %)" + autocmd FileType awk autocmd! BufWritePost silent !notify-send "$(awk -g -f % 2>&1 && awk -o- -f % | sponge % && echo 'awk OK:' %)" " File type function under cursor lookups. - autocmd FileType elixir noremap df :exe ':term ++rows=10 sh -c "echo ''h(' . expand('') . ')'' \| iex"' + autocmd FileType go noremap df :exe ':term ++rows=10 go doc ' . expand('') autocmd FileType nix noremap df :exe ':term ++rows=10 nixos-option ' . expand('') + autocmd FileType elixir noremap df :exe ':term ++rows=10 sh -c "echo ''h(' . expand('') . ')'' \| iex"' " REPL commands. autocmd FileType go noremap cc :REPL gore -- cgit v1.2.3