diff options
author | Johann Klähn <kljohann@gmail.com> | 2012-04-22 16:02:27 +0200 |
---|---|---|
committer | Johann Klähn <kljohann@gmail.com> | 2012-04-22 16:03:51 +0200 |
commit | 76ab0acaaa30b61b8482c4854f7f54eb92d0b6e8 (patch) | |
tree | c276e67ee4470e1f285249c36c1377a6d68f2d02 /contrib | |
parent | 5f85c72d082ac0fb482a7a9249c2d14300b73560 (diff) | |
download | fork-ledger-76ab0acaaa30b61b8482c4854f7f54eb92d0b6e8.tar.gz fork-ledger-76ab0acaaa30b61b8482c4854f7f54eb92d0b6e8.tar.bz2 fork-ledger-76ab0acaaa30b61b8482c4854f7f54eb92d0b6e8.zip |
vim. small fixes for syntax highlighting
Also pre-declarations aren't folded anymore because the current
'foldexpr' does not make too much sense for them.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/vim/syntax/ledger.vim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/vim/syntax/ledger.vim b/contrib/vim/syntax/ledger.vim index c2962742..c516bab0 100644 --- a/contrib/vim/syntax/ledger.vim +++ b/contrib/vim/syntax/ledger.vim @@ -18,7 +18,8 @@ syntax clear " ACCOUNT AMOUNT [; NOTE] <-- posting syn region ledgerTransaction start=/^[[:digit:]~=]/ skip=/^\s/ end=/^/ - \ fold keepend transparent contains=ledgerTransactionDate,ledgerMetadata,ledgerPosting + \ fold keepend transparent + \ contains=ledgerTransactionDate,ledgerMetadata,ledgerPosting,ledgerTransactionExpression syn match ledgerTransactionDate /^\d\S\+/ contained syn match ledgerTransactionExpression /^[=~]\s\+\zs.*/ contained syn match ledgerPosting /^\s\+[^[:blank:];][^;]*\ze\%($\|;\)/ @@ -28,7 +29,7 @@ syn match ledgerPosting /^\s\+[^[:blank:];][^;]*\ze\%($\|;\)/ syn match ledgerAccount /^\s\+\zs\%(\S\@<= \S\|\S\)\+\ze\%( \|\t\|\s*$\)/ contained syn region ledgerPreDeclaration start=/^\(account\|payee\|commodity\|tag\)/ skip=/^\s/ end=/^/ - \ fold keepend transparent + \ keepend transparent \ contains=ledgerPreDeclarationType,ledgerPreDeclarationName,ledgerPreDeclarationDirective syn match ledgerPreDeclarationType /^\(account\|payee\|commodity\|tag\)/ contained syn match ledgerPreDeclarationName /^\S\+\s\+\zs.*/ contained @@ -43,7 +44,7 @@ syn match ledgerTag /\%(\%(;\|^tag\)[^:]\+\)\@<=[^:]\+:\ze[^:]\+$/ contained syn match ledgerTypedTag /\%(\%(;\|^tag\)[^:]\+\)\@<=[^:]\+::\ze[^:]\+$/ contained syn region ledgerApply - \ matchgroup=ledgerApply start=/^apply\>/ + \ matchgroup=ledgerStartApply start=/^apply\>/ \ matchgroup=ledgerEndApply end=/^end\s\+apply\>/ \ contains=ledgerApplyHead,ledgerApply,ledgerTransaction,ledgerComment syn match ledgerApplyHead /\%(^apply\s\+\)\@<=\S.*$/ contained @@ -53,7 +54,7 @@ highlight default link ledgerTransactionExpression Statement highlight default link ledgerMetadata Tag highlight default link ledgerTypedTag Keyword highlight default link ledgerTag Type -highlight default link ledgerApply Tag +highlight default link ledgerStartApply Tag highlight default link ledgerEndApply Tag highlight default link ledgerApplyHead Type highlight default link ledgerAccount Identifier |