1
0
dotfiles/.config/zsh/lib/history.zsh

20 lines
300 B
Bash
Raw Normal View History

2021-03-21 18:25:10 +03:00
#!/bin/zsh
z-history() {
local list
2022-07-19 02:41:45 +03:00
2021-03-21 18:25:10 +03:00
zparseopts -E l=list
2024-02-23 21:46:04 +03:00
if [ -n "${list}" ]; then
2021-03-21 18:25:10 +03:00
builtin fc "$@"
else
[[ ${@[-1]-} = *[0-9]* ]] && builtin fc -il "$@" || builtin fc -il "$@" 1
fi
}
2021-12-07 02:46:50 +03:00
z-grephist() {
2022-07-19 02:41:45 +03:00
local x
x=$1 ; shift
z-history -m "*${x}*" "$@"
2021-12-07 02:46:50 +03:00
}