diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2020-03-29 21:26:52 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2020-03-29 21:30:37 +0900 |
| commit | 18261fe31cf1270f9aa783f99bbdbca343f89479 (patch) | |
| tree | f7301ce7be8c5b80761ceeed6d75669766aea364 /shell/key-bindings.bash | |
| parent | 079046863c0a9f5bc37d629bab02dccffcf329bc (diff) | |
| download | fzf-18261fe31cf1270f9aa783f99bbdbca343f89479.tar.gz | |
[shell] Update CTRL-R to remove duplicate commands
Close #1940
Related: #1363 #749 #270 #49 #88 #492 #600
Diffstat (limited to 'shell/key-bindings.bash')
| -rw-r--r-- | shell/key-bindings.bash | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index 71cd9991..16e1ec5b 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -55,7 +55,7 @@ __fzf_history__() { local output output=$( builtin fc -lnr -2147483648 | - last_hist=$(HISTTIMEFORMAT='' builtin history 1) perl -p -l0 -e 'BEGIN { getc; $/ = "\n\t"; $HISTCMD = $ENV{last_hist} + 1 } s/^[ *]//; $_ = $HISTCMD - $. . "\t$_"' | + last_hist=$(HISTTIMEFORMAT='' builtin history 1) perl -n -l0 -e 'BEGIN { getc; $/ = "\n\t"; $HISTCMD = $ENV{last_hist} + 1 } s/^[ *]//; print $HISTCMD - $. . "\t$_" if !$seen{$_}++' | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS +m --read0" $(__fzfcmd) --query "$READLINE_LINE" ) || return READLINE_LINE=${output#*$'\t'} |
