-
-
Save opennomad/18280decfcabdb7d54e8c257a3a07da3 to your computer and use it in GitHub Desktop.
Revisions
-
opennomad revised this gist
Jun 4, 2021 . 1 changed file with 2 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,8 @@ if [[ "$(command -v peco)" ]]; then # Search shell history with peco: https://github.com/peco/peco # Adapted from: https://github.com/mooz/percol#zsh-history-search function peco_select_history() { BUFFER=$(fc -lnr 1 | peco --initial-filter Regexp --query "$LBUFFER") CURSOR=$#BUFFER # move cursor zle -R -c # refresh } -
yuttie revised this gist
Oct 15, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,8 @@ if which peco &> /dev/null; then function peco_select_history() { local tac { which gtac &> /dev/null && tac="gtac" } || \ { which tac &> /dev/null && tac="tac" } || \ tac="tail -r" BUFFER=$(fc -l -n 1 | eval $tac | \ peco --layout=bottom-up --query "$LBUFFER") -
jimeh revised this gist
Aug 22, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,8 @@ if which peco &> /dev/null; then (which gtac &> /dev/null && tac="gtac") || \ (which tac &> /dev/null && tac="tac") || \ tac="tail -r" BUFFER=$(fc -l -n 1 | eval $tac | \ peco --layout=bottom-up --query "$LBUFFER") CURSOR=$#BUFFER # move cursor zle -R -c # refresh } -
jimeh revised this gist
Aug 15, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Search shell history with peco: https://github.com/peco/peco # Adapted from: https://github.com/mooz/percol#zsh-history-search if which peco &> /dev/null; then function peco_select_history() { local tac (which gtac &> /dev/null && tac="gtac") || \ (which tac &> /dev/null && tac="tac") || \ @@ -11,6 +11,6 @@ if which peco &> /dev/null; then zle -R -c # refresh } zle -N peco_select_history bindkey '^R' peco_select_history fi -
jimeh created this gist
Jul 14, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # Search shell history with peco: https://github.com/peco/peco # Adapted from: https://github.com/mooz/percol#zsh-history-search if which peco &> /dev/null; then function percol_select_history() { local tac (which gtac &> /dev/null && tac="gtac") || \ (which tac &> /dev/null && tac="tac") || \ tac="tail -r" BUFFER=$(fc -l -n 1 | eval $tac | peco --query "$LBUFFER") CURSOR=$#BUFFER # move cursor zle -R -c # refresh } zle -N percol_select_history bindkey '^R' percol_select_history fi