From 177e2aab6ec1a6ae2903a758667537a8baaa24e0 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 3 Jun 2016 16:25:49 +0800 Subject: zsh: adjust the order of history.zsh --- _zsh/50-history.zsh | 30 ------------------------------ _zsh/70-history.zsh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 30 deletions(-) delete mode 100644 _zsh/50-history.zsh create mode 100644 _zsh/70-history.zsh (limited to '_zsh') diff --git a/_zsh/50-history.zsh b/_zsh/50-history.zsh deleted file mode 100644 index 8b15561..0000000 --- a/_zsh/50-history.zsh +++ /dev/null @@ -1,30 +0,0 @@ -# -# zsh/history.zsh -# - -HISTFILE=~/.zsh_history - -HISTSIZE=10000 -SAVEHIST=9000 -# ignore these commands without arguments -HISTIGNORE="cd:ls:ll" - - -# Combine history search with `percol` -# Credit: https://github.com/mooz/percol -if exists percol; then - function percol_select_history() { - local tac - exists gtac && tac="gtac" || { - exists tac && tac="tac" || { - tac="tail -r" } } - BUFFER=$(fc -l -n 1 | eval ${tac} | percol --query "${LBUFFER}") - CURSOR=${#BUFFER} # move cursor - zle -R -c # refresh - } - - zle -N percol_select_history - bindkey '^R' percol_select_history -fi - -# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: # diff --git a/_zsh/70-history.zsh b/_zsh/70-history.zsh new file mode 100644 index 0000000..1d6ad6d --- /dev/null +++ b/_zsh/70-history.zsh @@ -0,0 +1,31 @@ +# +# zsh/history.zsh +# + +HISTFILE=~/.zsh_history + +HISTSIZE=10000 +SAVEHIST=9000 +# ignore these commands without arguments +HISTIGNORE="cd:ls:ll" + + +# Combine history search with `percol` +# Credit: https://github.com/mooz/percol +if exists percol; then + function percol_select_history() { + local tac + exists gtac && tac="gtac" || { + exists tac && tac="tac" || { + tac="tail -r" } } + BUFFER=$(fc -l -n 1 | eval ${tac} | percol --query "${LBUFFER}") + CURSOR=${#BUFFER} # move cursor + zle -R -c # refresh + } + + zle -N percol_select_history + # Override the bindkey settings in `60-bindkeys.zsh` + bindkey '^R' percol_select_history +fi + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: # -- cgit v1.2.2