- Fix your previous command by pressing Undo.
- Edit your history with the
hist
command.
On any new command line, you can now press Undo to pop the last command from your history into the line editor, letting you correct any mistakes you made before running it back. Afterwards, the old command will no longer be found.
(Check with bindkey
to see which keyboard shortcut is bound to undo
. zsh-hist
does not change
that.)
Usage:
hist [options] <action> [selection]
Options (can be combined):
-i interactive: ask for confirmation
-s silent: do not print anything
-v verbose: print all the things
Actions (required; mutually exclusive):
d delete: remove from history
e edit: remove from history, then modify & append as new
f fix: remove from history, then load into buffer
l list: look, but do not touch
r reload: re-initialize entire history from file
u undo: roll back to before last change in same session
Selection (required for some actions; mutually exclusive):
empty last event
positive integer index from beginning of history
negative integer offset from end of history
simple string prefix to match (selects one)
glob expression pattern to match (selects multiple)
© 2020 Marlon Richert
This project is licensed under the MIT License. See the LICENSE file for details.