vim-ledger icon indicating copy to clipboard operation
vim-ledger copied to clipboard

Support folding markers

Open adament opened this issue 10 years ago • 2 comments

First of all thank you very much for the nice vim plugin, it does everything it says. However I find myself wanting one additional feature:

I think it would be a huge benefit if the ledger folding code also supported custom folding markers. This would make it much easier to have a huge ledger file easily organized, you could for example have folds on years and months.

I imagine something like the following:

;{{{Year: 2011
;{{{Month: January

2011/01/01 * What a new years night!
    Expenses:Parties    $ 1500.00
    Assets:Checking
;}}}
;{{{Month:February
;}}}
;}}}

I want this to be integrated into the vim-ledger folding code rather than just using foldmethod=marker, since I would still much prefer the transactions to be folded.

adament avatar Jun 11 '14 05:06 adament

Thanks for the idea @adament. We'd be happy to see a contribution to this effect if you (or anyone) would like to put together a PR!

alerque avatar Jul 01 '19 14:07 alerque

I started working on this but don't have anything to contribute yet. The goofy part is I got it working once, but lost it. At the time I had so much junk floating around from failed attempts I thought I'd just clean that up before I committed anything. In the process of cleanup I lost whatever magic incantation made the thing work. I haven't been able to brew up the same magic since. It shouldn't be too hard, but the order of operations when evaluating syntax is kind of weird.

If anybody can figure it out I'm open for suggestions. Adding matches for the markers is easy. The tricky part is also nesting all the other syntax inside what ends up being new regions.

alerque avatar Mar 11 '21 10:03 alerque