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

Allow aligning on commidity char instead of decimal separator

Open entropitor opened this issue 5 years ago • 2 comments

I love this plugin. Unfortunately, it aligns on decimal separator while I'd prefer to align on the commodity symbol. It'd be nice if this plugin has support for that

entropitor avatar May 24 '20 17:05 entropitor

I'd love to accept a PR that accomplished that as an option! I don't have time to make it happen right now I'd be willing to help review and tweak and contributions that come up for merging.

I don't personally like the alignment either — but my beef is that I have multiple different localized currencies in my ledgers ($1,000.00, ₺1.000,00, 1 000,00 ₸, etc.) and the plugin cannot currently handle more than one decimal separator for alignment. Hence it aligns all my USD transactions at the thousands place and TRY transactions at the decimal.

I imagine a similar problem will come up aligning on commodities any time more than one is used in a ledger.

By the way my workaround is to do alignment via hledger print, but that's less than ideal for a number of reasons. It would be great to come up with a more robust alignment system for this plugin.

alerque avatar May 25 '20 05:05 alerque

Anybody that does try to work on this should probably take a gander at #95 before getting started.

alerque avatar May 25 '20 06:05 alerque