Add replay function
This commit is contained in:
parent
3092e88e60
commit
9dc69b2e1c
@ -65,3 +65,14 @@ up() {
|
||||
search () {
|
||||
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
|
||||
|
||||
# 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 HISTFILE=~/.zsh_history
|
||||
export SAVEHIST=10000
|
||||
|
Loading…
Reference in New Issue
Block a user