summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJohann Klähn <kljohann@gmail.com>2010-06-11 13:28:23 +0200
committerJohn Wiegley <johnw@newartisans.com>2010-06-11 17:02:24 -0400
commit31d8d41d0201e91b8cb2557c691df360ba982cbd (patch)
tree9d7ac2b53dead86700f29c192809c2a60383b852 /contrib
parentf7d872dbd2a9f65c1aae39abb80fe94326ada9af (diff)
downloadfork-ledger-31d8d41d0201e91b8cb2557c691df360ba982cbd.tar.gz
fork-ledger-31d8d41d0201e91b8cb2557c691df360ba982cbd.tar.bz2
fork-ledger-31d8d41d0201e91b8cb2557c691df360ba982cbd.zip
vim. add syntax highlighting for tag/pop
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.