summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-04-16 14:20:29 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-04-16 14:34:40 +0900
commitd08542ce5d4a81c13404311c3d1605654978bd1b (patch)
treedb5f62bb9b7b952a1f95b9b7d5643e0cb54c30eb /shell
parentb8904a8c3e8f6d8c00c8d69b153c0d1897b1ade2 (diff)
Prepare for 0.9.9 release
Diffstat (limited to 'shell')
-rw-r--r--shell/completion.bash14
-rw-r--r--shell/key-bindings.bash4
-rw-r--r--shell/key-bindings.fish2
-rw-r--r--shell/key-bindings.zsh2
4 files changed, 17 insertions, 5 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index 04287a64..62dc140c 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -16,9 +16,10 @@ _fzf_orig_completion_filter() {
}
_fzf_opts_completion() {
- local cur opts
+ local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="
-x --extended
-e --extended-exact
@@ -27,20 +28,31 @@ _fzf_opts_completion() {
-d --delimiter
+s --no-sort
--tac
+ --tiebreak
-m --multi
--no-mouse
+c --no-color
+2 --no-256
--black
--reverse
+ --no-hscroll
--prompt
-q --query
-1 --select-1
-0 --exit-0
-f --filter
--print-query
+ --expect
+ --toggle-sort
--sync"
+ case "${prev}" in
+ --tiebreak)
+ COMPREPLY=( $(compgen -W "length begin end index" -- ${cur}) )
+ return 0
+ ;;
+ esac
+
if [[ ${cur} =~ ^-|\+ ]]; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index d7f09030..d983bb16 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..,.. --toggle-sort=ctrl-r | sed \"s/ *[0-9]* *//\")\e\C-e\er"'
+ bind '"\C-r": " \C-e\C-u$(HISTTIMEFORMAT= history | fzf +s --tac +m -n2..,.. --tiebreak=index --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"'
@@ -62,7 +62,7 @@ else
bind -m vi-command '"\C-t": "i\C-t"'
# CTRL-R - Paste the selected command from history into the command line
- bind '"\C-r": "\eddi$(HISTTIMEFORMAT= history | fzf +s --tac +m -n2..,.. | sed \"s/ *[0-9]* *//\")\C-x\C-e\e$a\C-x\C-r"'
+ bind '"\C-r": "\eddi$(HISTTIMEFORMAT= history | fzf +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r | sed \"s/ *[0-9]* *//\")\C-x\C-e\e$a\C-x\C-r"'
bind -m vi-command '"\C-r": "i\C-r"'
# ALT-C - cd into the selected directory
diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish
index 6e9efa44..f5f79c45 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 --toggle-sort=ctrl-r > $TMPDIR/fzf.result
+ history | fzf +s +m --tiebreak=index --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 47806586..2bf42fa5 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..,.. --toggle-sort=ctrl-r -q "$LBUFFER"); then
+ if selected=$(fc -l 1 | fzf +s --tac +m -n2..,.. --tiebreak=index --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