In ledger-mode, how can I specify custom tabstops?

15 views
Skip to first unread message

dersuchmann

unread,
Jun 9, 2020, 9:23:40 AM6/9/20
to Ledger
Hello there, I've just started to work with ledger a week ago and am now switching to emacs for a couple of reasons.

For my personal ledger workflow, there are two things I would like to acheive, the second one of which I'm addressing in this topic.
--------------------
How can I adjust tabstops in ledger-mode? I'd like to have different columns for the amounts so I can use the tab key to jump to the first amount column, then use tab key again to jump to the second amount column. The reason is that I would like to visually separate the two sides of the double accounting that ledger encourages. (In my case there will be 3 columns because I'll also apply some custom tweaks... but yeah) It would be best if I could just manually adjust the columns with the tab key.

I found this for text mode, but I'm not sure if this can be easily adjusted to be used in ledger mode.

Any help is greatly appreciated!

Joost Kremers

unread,
Jun 9, 2020, 4:25:10 PM6/9/20
to ledge...@googlegroups.com

On Tue, Jun 09 2020, dersuchmann wrote:
> How can I adjust tabstops in ledger-mode? I'd like to have
> different
> columns for the amounts so I can use the tab key to jump to the
> first
> amount column, then use tab key again to jump to the second
> amount column.

I'm new to ledger and ledger-mode myself, but AFAICT you should be
able to achieve this by setting `ledger-mode-auto-align` to `nil`
to keep ledger-mode from auto-aligning transactions, and
`tab-always-indent` to `nil` to ensure that the TAB key inserts a
TAB character (or an equivalent number of spaces) when the cursor
is not at the beginning of the line. A quick test suggests that it
honours `tab-width` or `tab-stop-list`.

That way you could keep two amount columns, though you'll probably
have to do some manual work to make sure columns are aligned on
the decimal separator.

HTH

--
Joost Kremers
Life has its moments
Reply all
Reply to author
Forward
0 new messages