Skip to content

Instantly share code, notes, and snippets.

@memememomo
Created July 3, 2014 02:51
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 memememomo/5fa0341eb64472888a65 to your computer and use it in GitHub Desktop.
Save memememomo/5fa0341eb64472888a65 to your computer and use it in GitHub Desktop.
oh-my-zsh の環境で、peco-select-history が動かない ref: http://qiita.com/uchiko/items/f6b1528d7362c9310da0
function peco-select-history() {
local tac
if which tac > /dev/null; then
tac="tac"
else
tac="tail -r"
fi
BUFFER=$(\history -n 1 | \
eval $tac | \
peco --query "$LBUFFER")
CURSOR=$#BUFFER
zle clear-screen
}
zle -N peco-select-history
bindkey '^r' peco-select-history
...
# Show history
#if [ "$HIST_STAMPS" = "mm/dd/yyyy" ]
#then
# alias history='fc -fl 1'
#elif [ "$HIST_STAMPS" = "dd.mm.yyyy" ]
#then
# alias history='fc -El 1'
#elif [ "$HIST_STAMPS" = "yyyy-mm-dd" ]
#then
# alias history='fc -il 1'
#else
# alias history='fc -l 1'
#fi
...
$ history -n 1
fc: event not found: -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment