summaryrefslogtreecommitdiffhomepage
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
parent8e9ff08f39fd363c302456828861fbbd5c735c68 (diff)
Add syntax highlighting and autoformatting for mintages
-rw-r--r--.exrc12
-rw-r--r--contrib/syntax/mintage.vim8
2 files changed, 18 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>
diff --git a/contrib/syntax/mintage.vim b/contrib/syntax/mintage.vim
new file mode 100644
index 0000000..d4cb533
--- /dev/null
+++ b/contrib/syntax/mintage.vim
@@ -0,0 +1,8 @@
+if exists('b:current_syntax')
+ finish
+endif
+let b:current_syntax = 'mintage'
+
+syntax keyword Keyword BEGIN CIRC BU PROOF
+syntax match Label /[^\s]\+\*\?:/
+syntax match Number /[0-9\.]\+/