File tree Expand file tree Collapse file tree 3 files changed +37
-25
lines changed Expand file tree Collapse file tree 3 files changed +37
-25
lines changed Original file line number Diff line number Diff line change @@ -56,22 +56,25 @@ behaviour of the ledger filetype.
56
56
57
57
let g:ledger_fillstring = ' -'
58
58
59
- My special tip is to use so-called digraphs: Press <C-K > followed by the
60
- two-characters key sequence below. (in insert-mode)
61
-
62
- '. = ˙ or ': = ¨ --> ˙˙˙˙˙˙ or ¨¨¨¨¨¨
63
- ', = ¸ --> ¸¸¸¸¸¸
64
- .M = · --> ······
65
- >> = » --> »»»»»»
66
-
67
- All those look rather unobtrusive and provide a good visual aid to find the
68
- correct amount.
69
-
70
59
* If you want the account completion to be sorted by level of detail/depth
71
60
instead of alphabetical, include the following line:
72
61
73
62
let g:ledger_detailed_first = 1
74
63
64
+ * By default vim will fold ledger transactions, leaving surrounding blank lines
65
+ unfolded. You can use ` g:ledger_fold_blanks ` to hide blank lines following a
66
+ transaction.
67
+
68
+ let g:ledger_fold_blanks = 0
69
+
70
+ A value of 0 will disable folding of blank lines, 1 will allow folding of a
71
+ single blank line between transactions; any larger value will enable folding
72
+ undconditionally.
73
+
74
+ Note that only lines containing no trailing spaces are considered for
75
+ folding. You can take advantage of this to disable this feature on a
76
+ case-by-case basis.
77
+
75
78
Completion
76
79
----------
77
80
Original file line number Diff line number Diff line change @@ -71,22 +71,25 @@ behaviour of the ledger filetype.
71
71
72
72
let g:ledger_fillstring = ' -'
73
73
74
- My special tip is to use so-called digraphs: Press <C-K> followed by the
75
- two-characters key sequence below. (in insert-mode)
76
-
77
- '. = ˙ or ': = ¨ --> ˙˙˙˙˙˙ or ¨¨¨¨¨¨
78
- ', = ¸ --> ¸¸¸¸¸¸
79
- .M = · --> ······
80
- >> = » --> »»»»»»
81
-
82
- All those look rather unobtrusive and provide a good visual aid to find the
83
- correct amount.
84
-
85
74
* If you want the account completion to be sorted by level of detail/depth
86
75
instead of alphabetical, include the following line:
87
76
88
77
let g:ledger_detailed_first = 1
89
78
79
+ * By default vim will fold ledger transactions, leaving surrounding blank lines
80
+ unfolded. You can use 'g:ledger_fold_blanks' to hide blank lines following a
81
+ transaction.
82
+
83
+ let g:ledger_fold_blanks = 0
84
+
85
+ A value of 0 will disable folding of blank lines, 1 will allow folding of a
86
+ single blank line between transactions; any larger value will enable folding
87
+ undconditionally.
88
+
89
+ Note that only lines containing no trailing spaces are considered for
90
+ folding. You can take advantage of this to disable this feature on a
91
+ case-by-case basis.
92
+
90
93
==============================================================================
91
94
COMPLETION *ledger-completion*
92
95
Original file line number Diff line number Diff line change @@ -15,15 +15,21 @@ endif
15
15
let s: oe = v: version < 704 ? ' ' : ' \%#=1'
16
16
let s: lb1 = v: version < 704 ? ' \@<=' : ' \@1<='
17
17
18
+ let s: fb = get (g: , ' ledger_fold_blanks' , 0 )
19
+ let s: skip = s: fb > 0 ? ' \|^\n' : ' '
20
+ if s: fb == 1
21
+ let s: skip .= ' \n\@!'
22
+ endif
23
+
18
24
" for debugging
19
25
syntax clear
20
26
21
27
" DATE[=EDATE] [*|!] [(CODE)] DESC <-- first line of transaction
22
28
" ACCOUNT AMOUNT [; NOTE] <-- posting
23
29
24
- syn region ledgerTransaction start =/ ^[[:digit:]~=]/ skip = / ^ \s / end = / ^ /
25
- \ fold keepend transparent
26
- \ contains= ledgerTransactionDate,ledgerMetadata,ledgerPosting,ledgerTransactionExpression
30
+ exe ' syn region ledgerTransaction start=/^[[:digit:]~=]/ ' .
31
+ \ ' skip=/^\s ' . s: skip . ' / end=/^/ fold keepend transparent ' .
32
+ \ ' contains=ledgerTransactionDate,ledgerMetadata,ledgerPosting,ledgerTransactionExpression'
27
33
syn match ledgerTransactionDate / ^\d\S\+ / contained
28
34
syn match ledgerTransactionExpression / ^[=~]\s\+\z s.*/ contained
29
35
syn match ledgerPosting / ^\s\+ [^[:blank:];][^;]*\z e\% ($\| ;\) /
You can’t perform that action at this time.
0 commit comments