Last active
November 13, 2016 02:53
-
-
Save operando/250da59cc97d89c33337fe5b129e09f5 to your computer and use it in GitHub Desktop.
peco select adb history
This file contains 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
# adb history | |
function peco-select-adb-history() { | |
local tac | |
if which tac > /dev/null; then | |
tac="tac" | |
else | |
tac="tail -r" | |
fi | |
BUFFER=$(\history -n 1 | \ | |
eval $tac | \ | |
grep adb | \ | |
peco --query "$LBUFFER") | |
CURSOR=$#BUFFER | |
zle clear-screen | |
} | |
zle -N peco-select-adb-history | |
bindkey '^a' peco-select-adb-history |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment