Created
July 3, 2014 02:51
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
# 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 | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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