summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-08-08 01:20:14 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-08-08 01:20:14 +0200
commit61b442c98a7a36bf4fa717f20cd9860971cced7c (patch)
treea7c617551d3fdbeb9114bd64b18db16d0121b435
parenta02a4f2765a3916ba8242d9919244dc12624e5b7 (diff)
Fix ‘templ fmt’ with '{{' and '}}'
-rw-r--r--.exrc6
1 files changed, 4 insertions, 2 deletions
diff --git a/.exrc b/.exrc
index c1f065a..2de0b63 100644
--- a/.exrc
+++ b/.exrc
@@ -4,7 +4,9 @@ function s:SaveExcursion(cmd)
call winrestview(l:win)
endfunction
-autocmd BufWritePre *.go call s:SaveExcursion('gofmt -s')
-autocmd BufWritePre *.templ call s:SaveExcursion('templ fmt')
+autocmd BufWritePre *.go
+ \ call s:SaveExcursion("gofmt -s")
+autocmd BufWritePre *.templ
+ \ call s:SaveExcursion("templ fmt | sed 's/{ {/{{/; s/} }/}}/'")
let g:netrw_list_hide .= ',.*_templ.go$'