summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-03-31 22:05:02 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-03-31 22:05:16 +0900
commit50292adacbad70f9561bc1e22ccbd3adea22481a (patch)
tree72a9ba657933585b7c56798b71b64a206144421b /shell
parent84a7499ae357bc3b3a82890d2e44d9c300af0c13 (diff)
Implement --toggle-sort option (#173)
Diffstat (limited to 'shell')
-rw-r--r--shell/key-bindings.bash2
-rw-r--r--shell/key-bindings.fish2
-rw-r--r--shell/key-bindings.zsh2
3 files changed, 3 insertions, 3 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index 90112475..d7f09030 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -44,7 +44,7 @@ if [ -z "$(set -o | \grep '^vi.*on')" ]; then
fi
# CTRL-R - Paste the selected command from history into the command line
- bind '"\C-r": " \C-e\C-u$(HISTTIMEFORMAT= history | fzf +s --tac +m -n2..,.. | sed \"s/ *[0-9]* *//\")\e\C-e\er"'
+ bind '"\C-r": " \C-e\C-u$(HISTTIMEFORMAT= history | fzf +s --tac +m -n2..,.. --toggle-sort=ctrl-r | sed \"s/ *[0-9]* *//\")\e\C-e\er"'
# ALT-C - cd into the selected directory
bind '"\ec": " \C-e\C-u$(__fcd)\e\C-e\er\C-m"'
diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish
index ce1eea75..6e9efa44 100644
--- a/shell/key-bindings.fish
+++ b/shell/key-bindings.fish
@@ -44,7 +44,7 @@ function fzf_key_bindings
end
function __fzf_ctrl_r
- history | fzf +s +m > $TMPDIR/fzf.result
+ history | fzf +s +m --toggle-sort=ctrl-r > $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 6eb80839..47806586 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -45,7 +45,7 @@ bindkey '\ec' fzf-cd-widget
# CTRL-R - Paste the selected command from history into the command line
fzf-history-widget() {
local selected
- if selected=$(fc -l 1 | fzf +s --tac +m -n2..,.. -q "$LBUFFER"); then
+ if selected=$(fc -l 1 | fzf +s --tac +m -n2..,.. --toggle-sort=ctrl-r -q "$LBUFFER"); then
num=$(echo "$selected" | head -1 | awk '{print $1}' | sed 's/[^0-9]//g')
LBUFFER=!$num
zle expand-history