summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.exrc9
1 files changed, 9 insertions, 0 deletions
diff --git a/.exrc b/.exrc
index 5682015..c1f065a 100644
--- a/.exrc
+++ b/.exrc
@@ -1 +1,10 @@
+function s:SaveExcursion(cmd)
+ let l:win = winsaveview()
+ execute '%!' .. a:cmd
+ call winrestview(l:win)
+endfunction
+
+autocmd BufWritePre *.go call s:SaveExcursion('gofmt -s')
+autocmd BufWritePre *.templ call s:SaveExcursion('templ fmt')
+
let g:netrw_list_hide .= ',.*_templ.go$'