Last active
September 12, 2018 04:53
-
-
Save rkaneko/d283bc8b92f1354ce38b0ea8673740ab to your computer and use it in GitHub Desktop.
Selecting command history extension using peco on bash
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
export HISTCONTROL="ignoredups" | |
_peco_select_history() { | |
local l=$(HISTTIMEFORMAT= history | tac | sed -e 's/^\s*[0-9]*\+\s\+//' | peco --query "$READLINE_LINE") | |
READLINE_LINE="$l" | |
READLINE_POINT=${#l} | |
} | |
bind -x '"\C-r":_peco_select_history' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment