hledger
hledger copied to clipboard
Vi-like readline in hledger add
Thank you for the many years of hard work on this project! Makes tax season much more bearable.
Is it possible to use vi-like keybindings inside hledger add? (emulate readline functionality with set -o vi)?
While I agree VI-like readline bindings would be cool (zle even cooler), one way you can go is using real VIM to edit your ledger ;-) Just a friendly note to say that I keep vim-ledger hledger compatible because this is what I use.
An interactive mode has been requested (cf. https://github.com/ledger/vim-ledger/issues/18) but is not immanent. The vim-ledger_x project has a bit more interactive approach to things, but also has more rough edges.
@alerque thank you for the suggestion (and your work on vim-ledger). I will try it out! I have been using the vis editor instead of (n)vim for the last few months, and I've found that the structural regular expressions facilitate the process of editing many transactions simultaneously. But when it comes to adding transactions one at a time, I think vim-ledger will prove very useful.
AFAIK, vi-mode would come for free with readline. Is there a reason hledger is not using readline for input?
hledger uses haskeline (https://hackage.haskell.org/package/haskeline), a Haskell-native readline-like. Someone could research whether haskeline supports these things..
Turns out it actually does have a vi mode! :tada: https://github.com/judah/haskeline/wiki/UserPreferences
Hurrah! Is there something we need to do to enable it ?
No, it's just a config file, similar to readline's ~/.inputrc. A bit weird, since, as a user, you don't necessarily know or care, which library a software uses. But... works for me... :shrug: