[shell] Add --highlight-line to CTRL-R bindings
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Junegunn Choi · committed by Junegunn Choi · parent 12630b1 · Browse files · 3 files·+4 added−4 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+4 added−4 removed
- other:+4 added−4 removed
Provenance
- Commit
ed53ef7- Tree
15fcc63- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
12630b1
3 files changed+4 added−4 removed
modified:shell/key-bindings.bash+2 added-2 removed
60 unmodified lines6162636465656667686920 unmodified lines9091929394949596979848 unmodified lines60 unmodified lines output=$( set +o pipefail builtin fc -lnr -2147483648 | last_hist=$(HISTTIMEFORMAT='' builtin history 1) command perl -n -l0 -e "$script" | FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0") \ FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --highlight-line ${FZF_CTRL_R_OPTS-} +m --read0") \ FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd) --query "$READLINE_LINE" ) || return READLINE_LINE=${output#*$'\t'} if [[ -z "$READLINE_POINT" ]]; then20 unmodified lines output=$( set +o pipefail builtin fc -lnr -2147483648 2> /dev/null | # ( $'\t '<lines>$'\n' )* ; <lines> ::= [^\n]* ( $'\n'<lines> )* command $__fzf_awk "$script" | # ( <counter>$'\t'<lines>$'\000' )* FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0") \ FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --highlight-line ${FZF_CTRL_R_OPTS-} +m --read0") \ FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd) --query "$READLINE_LINE" ) || return READLINE_LINE=${output#*$'\t'} if [[ -z "$READLINE_POINT" ]]; then48 unmodified linesmodified:shell/key-bindings.fish+1 added-1 removed
57 unmodified lines58 59 function fzf-history-widget -d "Show command history"60 test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%61 begin62- set -lx FZF_DEFAULT_OPTS (__fzf_defaults "" "--scheme=history --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS +m")62+ set -lx FZF_DEFAULT_OPTS (__fzf_defaults "" "--scheme=history --bind=ctrl-r:toggle-sort --highlight-line $FZF_CTRL_R_OPTS +m")63 set -lx FZF_DEFAULT_OPTS_FILE ''64 65 set -l FISH_MAJOR (echo $version | cut -f1 -d.)66 set -l FISH_MINOR (echo $version | cut -f2 -d.)120 unmodified linesmodified:shell/key-bindings.zsh+1 added-1 removed
107 unmodified lines108 fzf-history-widget() {109 local selected num110 setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null111 selected="$(fc -rl 1 | awk '{ cmd=$0; sub(/^[ \t]*[0-9]+\**[ \t]+/, "", cmd); if (!seen[cmd]++) print $0 }' |112- FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} --query=${(qqq)LBUFFER} +m") \112+ FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --highlight-line ${FZF_CTRL_R_OPTS-} --query=${(qqq)LBUFFER} +m") \113 FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd))"114 local ret=$?115 if [ -n "$selected" ]; then116 num=$(awk '{print $1}' <<< "$selected")19 unmodified lines