summaryrefslogtreecommitdiffhomepage
path: root/.exrc
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-08-09 19:18:15 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-08-09 19:18:15 +0200
commit0f604fbedb093ca0c83bc85a3b0fb3504224258a (patch)
treed74fc4893fe4576b0cdf99cb56eb3f7212baef01 /.exrc
parent8e9ff08f39fd363c302456828861fbbd5c735c68 (diff)
Add syntax highlighting and autoformatting for mintages
Diffstat (limited to '.exrc')
-rw-r--r--.exrc12
1 files changed, 10 insertions, 2 deletions
diff --git a/.exrc b/.exrc
index 1460ac2..7d08655 100644
--- a/.exrc
+++ b/.exrc
@@ -1,3 +1,5 @@
+set runtimepath+=contrib
+
" We make use of this feature, so set this in the environment so that all
" Ex-calls to templ are aware of this
call setenv("TEMPL_EXPERIMENT", "rawgo")
@@ -8,8 +10,14 @@ 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 BufNewFile,BufRead */data/mintages/* setfiletype mintage
+
+autocmd FileType go autocmd BufWritePre <buffer>
+ \ call s:SaveExcursion("gofmt -s")
+autocmd FileType mintage autocmd BufWritePre <buffer>
+ \ call s:SaveExcursion("./mfmt")
+autocmd FileType templ autocmd BufWritePre <buffer>
+ \ call s:SaveExcursion("templ fmt")
nnoremap <silent> gM :wall \| make all-i18n<CR>
nnoremap <silent> <LocalLeader>t :vimgrep /TODO/ **/*<CR>