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

Vi-like readline in hledger add #1502

Open
josephmturner opened this issue Mar 11, 2021 · 7 comments
Open

Vi-like readline in hledger add #1502

josephmturner opened this issue Mar 11, 2021 · 7 comments
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. add

Comments

@josephmturner
Copy link

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)?

@alerque
Copy link
Collaborator

alerque commented Mar 11, 2021

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. ledger/vim-ledger#18) but is not immanent. The vim-ledger_x project has a bit more interactive approach to things, but also has more rough edges.

@josephmturner
Copy link
Author

@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.

@simonmichael simonmichael added A-WISH Some kind of improvement request, hare-brained proposal, or plea. add labels Mar 12, 2021
@alerque alerque reopened this Mar 14, 2021
@tsujigiri
Copy link

AFAIK, vi-mode would come for free with readline. Is there a reason hledger is not using readline for input?

@simonmichael
Copy link
Owner

hledger uses haskeline (https://hackage.haskell.org/package/haskeline), a Haskell-native readline-like. Someone could research whether haskeline supports these things..

@tsujigiri
Copy link

Turns out it actually does have a vi mode! 🎉
https://github.com/judah/haskeline/wiki/UserPreferences

@simonmichael
Copy link
Owner

simonmichael commented Aug 19, 2023 via email

@tsujigiri
Copy link

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... 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. add
Projects
None yet
Development

No branches or pull requests

4 participants