Skip to content
Myr

[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

3 files+4 added−4 removed

modified:shell/key-bindings.bash+2 added-2 removed
modified:shell/key-bindings.fish+1 added-1 removed
57 unmodified lines
5859 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 ''6465 set -l FISH_MAJOR (echo $version | cut -f1 -d.)66 set -l FISH_MINOR (echo $version | cut -f2 -d.)
120 unmodified lines
modified:shell/key-bindings.zsh+1 added-1 removed
107 unmodified lines
108fzf-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