1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

fzf-history: don't enable by default and reverse

This commit is contained in:
Daiderd Jordan 2017-02-21 21:18:15 +01:00
parent c5f39b353d
commit c4e573258d
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 3 additions and 2 deletions

View file

@ -80,7 +80,7 @@ in
programs.zsh.enableFzfHistory = mkOption {
type = types.bool;
default = true;
default = false;
description = "Enable fzf keybinding for Ctrl-r history search.";
};

View file

@ -12,7 +12,7 @@ fzf-history-widget() {
local selected num
setopt localoptions noglobsubst pipefail 2> /dev/null
selected=( $(fc -l 1 |
FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS +s --tac -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(q)LBUFFER} +m" $(__fzfcmd)) )
FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS +s --tac -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(q)LBUFFER} +m" $(__fzfcmd)) )
local ret=$?
if [ -n "$selected" ]; then
num=$selected[1]
@ -24,5 +24,6 @@ fzf-history-widget() {
typeset -f zle-line-init >/dev/null && zle zle-line-init
return $ret
}
zle -N fzf-history-widget
bindkey '^R' fzf-history-widget