Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support folding markers #19

Open
adament opened this issue Jun 11, 2014 · 2 comments
Open

Support folding markers #19

adament opened this issue Jun 11, 2014 · 2 comments

Comments

@adament
Copy link

adament commented Jun 11, 2014

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.

@alerque
Copy link
Member

alerque commented Jul 1, 2019

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
Copy link
Member

alerque commented Mar 11, 2021

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 alerque removed their assignment Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants