fzf: Remove Alt-s for sorting, remove useless --tiebreak

master
Pierre Neidhardt 2017-05-07 16:46:42 +05:30
parent 05b888e41f
commit 2c20c7742f
2 changed files with 4 additions and 4 deletions

View File

@ -4,10 +4,10 @@ bind \e\ct fzf-file-widget
bind \ec capitalize-word
bind \eC fzf-cd-widget
function fzf-select -d 'fzf commandline and print unescaped selection back to commandline'
function fzf-select -d 'Eval commandline, fzf result and print out selection'
set -l cmd (commandline -j)
[ "$cmd" ]; or return
eval $cmd | eval (__fzfcmd) -m --tiebreak=index --select-1 --exit-0 | string join ' ' | read -l result
eval $cmd | eval (__fzfcmd) -m --select-1 --exit-0 | string join ' ' | read -l result
[ "$result" ]; and commandline -j -- $result
commandline -f repaint
end
@ -24,7 +24,7 @@ bind \e\cm fzf-select
function fzf-complete -d 'fzf completion and print selection back to commandline'
set -l complist (complete -C(commandline -c))
set -l result
string join -- \n $complist | sort | fzf -m --tiebreak=index --select-1 --exit-0 --header '(commandline)' | cut -f1 | while read -l r; set result $result $r; end
string join -- \n $complist | sort | fzf -m --select-1 --exit-0 --header '(commandline)' | cut -f1 | while read -l r; set result $result $r; end
set prefix (string sub -s 1 -l 1 -- (commandline -t))
for i in (seq (count $result))

View File

@ -130,7 +130,7 @@ fi
## fzf
if command -v fzf >/dev/null 2>&1; then
export FZF_DEFAULT_OPTS="--reverse --inline-info --height 40% --cycle --extended --multi --select-1 --exit-0 --bind=ctrl-k:kill-line,ctrl-j:accept,alt-s:toggle-sort,ctrl-v:page-down,alt-v:page-up,alt-a:toggle-all,alt-i:toggle-up,alt-z:toggle-preview"
export FZF_DEFAULT_OPTS="--reverse --inline-info --height 40% --cycle --extended --multi --select-1 --exit-0 --bind=ctrl-k:kill-line,ctrl-j:accept,ctrl-v:page-down,alt-v:page-up,alt-a:toggle-all,alt-i:toggle-up,alt-z:toggle-preview"
export FZF_ALT_C_OPTS="--preview='preview {}'"
export FZF_BCD_OPTS=$FZF_ALT_C_OPTS
export FZF_CDHIST_OPTS=$FZF_ALT_C_OPTS