From 61b442c98a7a36bf4fa717f20cd9860971cced7c Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 8 Aug 2024 01:20:14 +0200 Subject: Fix ‘templ fmt’ with '{{' and '}}' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .exrc | 6 ++++-- 1 file 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$' -- cgit v1.2.3