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