Add replay function
This commit is contained in:
parent
3092e88e60
commit
9dc69b2e1c
@ -65,3 +65,14 @@ up() {
|
|||||||
search () {
|
search () {
|
||||||
grep -r "$1" | fzf
|
grep -r "$1" | fzf
|
||||||
}
|
}
|
||||||
|
# Usage: replay <number of commands> to repeat. Blank for 1
|
||||||
|
replay() {
|
||||||
|
from="${1:-2}"
|
||||||
|
to="${2:-1}"
|
||||||
|
if [ "$from" -ne "$to" ]; then
|
||||||
|
for i in `seq "$from" -1 "$(($to + 1))"`; do
|
||||||
|
printf "$(fc -ln -${i} -${i}) && "
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
$(fc -ln -${to} -${to})
|
||||||
|
}
|
@ -4,7 +4,7 @@ source ~/dotfiles/shell/aliases
|
|||||||
source ~/dotfiles/shell/functions
|
source ~/dotfiles/shell/functions
|
||||||
|
|
||||||
# History Settings
|
# History Settings
|
||||||
export HISTIGNORE="&:ls:[bf]g:exit:reset:clear:cd:cd ..:cd.."
|
export HISTIGNORE="&:ls:[bf]g:exit:reset:clear:cd:cd ..:cd..:replay"
|
||||||
export HISTSIZE=25000
|
export HISTSIZE=25000
|
||||||
export HISTFILE=~/.zsh_history
|
export HISTFILE=~/.zsh_history
|
||||||
export SAVEHIST=10000
|
export SAVEHIST=10000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user