diff --git a/shell/functions b/shell/functions index cf827d4..dc73f79 100644 --- a/shell/functions +++ b/shell/functions @@ -65,3 +65,14 @@ up() { search () { grep -r "$1" | fzf } +# Usage: replay 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}) +} \ No newline at end of file diff --git a/shell/zshrc b/shell/zshrc index 3b1e740..184b55d 100644 --- a/shell/zshrc +++ b/shell/zshrc @@ -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