From a57b375b413e12b01e648d4fcaf91e29a53ae75d Mon Sep 17 00:00:00 2001
From: Junegunn Choi <junegunn.c@gmail.com>
Date: Wed, 23 Mar 2016 03:00:20 +0900
Subject: [PATCH] Add $FZF_CTRL_R_OPTS for overriding the default options for
 CTRL-R

Close #526
---
 shell/key-bindings.bash | 2 +-
 shell/key-bindings.fish | 2 +-
 shell/key-bindings.zsh  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index 34adc2bc..042e005c 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -49,7 +49,7 @@ __fzf_history__() (
   shopt -u nocaseglob nocasematch
   line=$(
     HISTTIMEFORMAT= history |
-    $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r |
+    $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS |
     \grep '^ *[0-9]') &&
     if [[ $- =~ H ]]; then
       sed 's/^ *\([0-9]*\)\** .*/!\1/' <<< "$line"
diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish
index 40a1fee6..0a68b623 100644
--- a/shell/key-bindings.fish
+++ b/shell/key-bindings.fish
@@ -27,7 +27,7 @@ function fzf_key_bindings
   end
 
   function __fzf_ctrl_r
-    history | eval (__fzfcmd) +s +m --tiebreak=index --toggle-sort=ctrl-r > $TMPDIR/fzf.result
+    history | eval (__fzfcmd) +s +m --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS > $TMPDIR/fzf.result
     and commandline (cat $TMPDIR/fzf.result)
     commandline -f repaint
     rm -f $TMPDIR/fzf.result
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index 5817ee80..8d01437a 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -38,7 +38,7 @@ bindkey '\ec' fzf-cd-widget
 # CTRL-R - Paste the selected command from history into the command line
 fzf-history-widget() {
   local selected num
-  selected=( $(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "${LBUFFER//$/\\$}") )
+  selected=( $(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS -q "${LBUFFER//$/\\$}") )
   if [ -n "$selected" ]; then
     num=$selected[1]
     if [ -n "$num" ]; then
-- 
GitLab