summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann Klähn <kljohann@gmail.com>2010-10-07 18:09:01 +0200
committerJohann Klähn <kljohann@gmail.com>2010-10-07 18:09:01 +0200
commit64ce9e2e99423436329a2ea207c4f45bb17f8766 (patch)
tree80f349101326cb8994eeedb583ee0afc5d658b9a
parent4d56417f750fe9eb473ae59eefb1a79bdc7d42f1 (diff)
downloadfork-ledger-64ce9e2e99423436329a2ea207c4f45bb17f8766.tar.gz
fork-ledger-64ce9e2e99423436329a2ea207c4f45bb17f8766.tar.bz2
fork-ledger-64ce9e2e99423436329a2ea207c4f45bb17f8766.zip
vim. highlight typed tags
See mailing list on June 12 2010 / "New: Support for typed metadata" Message-Id: <D22C04C4-64F7-49B9-8006-2F7F97A4298A@gmail.com>
-rw-r--r--contrib/vim/syntax/ledger.vim6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/vim/syntax/ledger.vim b/contrib/vim/syntax/ledger.vim
index 2a49e93b..d4097e2b 100644
--- a/contrib/vim/syntax/ledger.vim
+++ b/contrib/vim/syntax/ledger.vim
@@ -40,9 +40,10 @@ syn match ledgerAccount /^\s\+\zs\%(\S \S\|\S\)\+\ze\%( \|\t\|\s*$\)/ contained
syn match ledgerComment /^;.*$/
" comments at eol must be preceeded by at least 2 spaces / 1 tab
syn region ledgerMetadata start=/\%( \|\t\|^\s\+\);/ skip=/^\s\+;/ end=/^/
- \ keepend contained contains=ledgerTag
+ \ keepend contained contains=ledgerTag,ledgerTypedTag
syn match ledgerTag /:[^:]\+:/hs=s+1,he=e-1 contained
-syn match ledgerTag /\%(\%(;\|^tag\)[^:]\+\)\@<=[^:]\+\ze:[^:]\+$/ contained
+syn match ledgerTag /\%(\%(;\|^tag\)[^:]\+\)\@<=[^:]\+:\ze[^:]\+$/ contained
+syn match ledgerTypedTag /\%(\%(;\|^tag\)[^:]\+\)\@<=[^:]\+::\ze[^:]\+$/ contained
syn region ledgerTagStack
\ matchgroup=ledgerTagPush start=/^tag\>/
@@ -52,6 +53,7 @@ syn match ledgerTagHead /\%(^tag\s\+\)\@<=\S.*$/ contained contains=ledgerTag tr
highlight default link ledgerTransactionDate Constant
highlight default link ledgerMetadata Tag
+highlight default link ledgerTypedTag Keyword
highlight default link ledgerTag Type
highlight default link ledgerTagPop Tag
highlight default link ledgerTagPush Tag