summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-13 00:42:25 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-13 00:42:25 -0400
commit40f553228f5a28034c6635fdcb4c86af28a385ed (patch)
tree2c40305c9f9841a4c3d453a4a5c49ec69056b4b2 /contrib
parent556211e623cad88213e5087b5c9c36e754d9aa02 (diff)
parentb1b4e2aadff5983d443d70c09ea86a41b015873f (diff)
downloadfork-ledger-40f553228f5a28034c6635fdcb4c86af28a385ed.tar.gz
fork-ledger-40f553228f5a28034c6635fdcb4c86af28a385ed.tar.bz2
fork-ledger-40f553228f5a28034c6635fdcb4c86af28a385ed.zip
Merge branch 'next'
Diffstat (limited to 'contrib')
-rw-r--r--contrib/vim/syntax/ledger.vim14
1 files changed, 12 insertions, 2 deletions
diff --git a/contrib/vim/syntax/ledger.vim b/contrib/vim/syntax/ledger.vim
index c96e4c3c..61f9a2e5 100644
--- a/contrib/vim/syntax/ledger.vim
+++ b/contrib/vim/syntax/ledger.vim
@@ -43,14 +43,24 @@ let s:currency = '\([$€£¢]\|\w\+\)'
let s:figures = '\d\+\([.,]\d\+\)*'
let s:amount = '-\?\('.s:figures.'\s*'.s:currency.'\|'.s:currency.'\s*'.s:figures.'\)'
exe 'syn match Amount /'.s:amount.'/ contained'
-syn match MetadataTag /:\zs[^:]\+\ze:\|;\s*\zs[^:]\+\ze:[^:]\+$/ contained
+syn match MetadataTag /:[^:]\+:/hs=s+1,he=e-1 contained
+syn match MetadataTag /;\s*\zs[^:]\+\ze:[^:]\+$/ contained
+syn region TagStack
+ \ matchgroup=TagPush start=/^tag\>/
+ \ matchgroup=TagPop end=/^pop\>/
+ \ contains=TagHead,TagStack,transNorm
+syn match TagHead /\%(^tag\s\+\)\@<=\S.*$/ contained contains=tagKey transparent
+syn match TagKey /:[^:]\+:/hs=s+1,he=e-1 contained
+syn match TagKey /\%(^tag\s\+\)\@<=[^:]\+\ze:[^:]\+$/ contained
highlight default link transDate Constant
highlight default link Metadata Tag
highlight default link MetadataTag Type
+highlight default link TagPop Tag
+highlight default link TagPush Tag
+highlight default link TagKey Type
highlight default link Amount Number
-highlight default link Comment Comment
highlight default link Account Identifier
" syncinc is easy: search for the first transaction.