mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-20 09:33:42 -05:00
Improve repeat history for zsh
@@ -59,6 +59,15 @@ fh() {
|
||||
}
|
||||
```
|
||||
|
||||
```sh
|
||||
# fh - repeat history
|
||||
fh() {
|
||||
print -z $(([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s | sed 's/ *[0-9]* *//')
|
||||
}
|
||||
```
|
||||
|
||||
Replacing `eval` with `print -z` will push the arguments onto the editing buffer stack, allowing you to edit the command before running it. It also means the command you run will appear in your history rather than just `fh`. Unfortunately this only works for zsh.
|
||||
|
||||
Processes
|
||||
---------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user