From 76ab0acaaa30b61b8482c4854f7f54eb92d0b6e8 Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Sun, 22 Apr 2012 16:02:27 +0200 Subject: 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. --- contrib/vim/syntax/ledger.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'contrib') 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 -- cgit v1.2.3