Skip to content

Instantly share code, notes, and snippets.

@waltarix
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waltarix/93535792ad9cc3e9e709 to your computer and use it in GitHub Desktop.
Save waltarix/93535792ad9cc3e9e709 to your computer and use it in GitHub Desktop.
peco_select_history for zsh
# vim:ft=zsh
whence peco &>/dev/null && function {
function peco_select_history {
emulate -L zsh
local delimiter=$'\0; \0' newline=$'\n'
BUFFER=${"$(print -rl ${history//$newline/$delimiter} | peco --query "$LBUFFER")"//$delimiter/$newline}
CURSOR=$#BUFFER
zle -Rc
zle reset-prompt
}
zle -N peco_select_history
bindkey "^Xh" peco_select_history
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment