You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is a crazy proposal for discussion.
iadd's keybindings work just great, but there comes a point where more exotic or unusual things maybe be shouldn't be jammed in there. This suggestion is for a key-binding on a leading ":", like when using vim, to preface vim-commands, or when using a leading ":!" to execute arbitrary shell commands.
:command
might have some iadd core navigation/ commands, and might also be configured to run any other hledger command, like reg or bal or..
:!exec
might be used to launch aliases, scripts or macros or just to issue a shell command (see #20 and #21)
in either case, on clean exit, iadd would resume entry of the transaction, and if the command exits with error, the error-message (if any) should be displayed and the iadd "Cancel Transaction? Y/n" should be triggered.
for your consideration.
The text was updated successfully, but these errors were encountered:
While I like vim-like ex-commands in many curses applications, I think it would probably be overkill for hledger-iadd. We currently have 13 different key bindings of which two are aliases for other keys (C-d and F1).
We also could not use the colon as prefix, because it's something the user might want to enter in the text area (e.g for account names).
:command
might have some iadd core navigation/ commands, and might also be configured to run any other hledger command, like reg or bal or..
Like I said above, I'm not sure this is necessary right now. Maybe if iadd gains a lot new features, but currently there are only a handful of core functions (navigation, accept, comment, undo, quit) with a few variations. Ex-commands have the advantage over key bindings of being mnemonic but as long as the key bindings fit on a small in-app help screen, I don't think that's very important. This advantage would also be mitigated by implementing @simonmichael's proposal of a permanent help bar at the top or bottom.
I can't think of a good reason to have hledger commands like bal or reg available from within iadd as opposed of just running them in another terminal. Do you have any use-case in mind?
:!exec
might be used to launch aliases, scripts or macros or just to issue a shell command (see #20 and #21)
This would be very useful! As outlined above, we'd need to bind it to something other than :!. A prompt for an arbitrary shell command to pipe the current transaction to would indeed solve #20 and #21; add a nice persistent command history and we don't even need a config option for that any more.
this is a crazy proposal for discussion.
iadd's keybindings work just great, but there comes a point where more exotic or unusual things maybe be shouldn't be jammed in there. This suggestion is for a key-binding on a leading ":", like when using vim, to preface vim-commands, or when using a leading ":!" to execute arbitrary shell commands.
:command
might have some iadd core navigation/ commands, and might also be configured to run any other hledger command, like reg or bal or..
:!exec
might be used to launch aliases, scripts or macros or just to issue a shell command (see #20 and #21)
in either case, on clean exit, iadd would resume entry of the transaction, and if the command exits with error, the error-message (if any) should be displayed and the iadd "Cancel Transaction? Y/n" should be triggered.
for your consideration.
The text was updated successfully, but these errors were encountered: