Skip to content

Commit

Permalink
[bash] Allow passing args to __fzf_select__ via fzf-file-widget (#2783)
Browse files Browse the repository at this point in the history
This makes it easier to make customizations, for example instead of

    bind -x '"\C-o\C-i": FZF_CTRL_T_COMMAND="fasd -Rl" FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --tiebreak=index " fzf-file-widget'

it's enough to just

    bind -x '"\C-o\C-i": FZF_CTRL_T_COMMAND="fasd -Rl" fzf-file-widget --tiebreak=index'
  • Loading branch information
jan-warchol committed Apr 6, 2022
1 parent 2093667 commit 3312cf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shell/key-bindings.bash
Expand Up @@ -32,7 +32,7 @@ __fzfcmd() {
}

fzf-file-widget() {
local selected="$(__fzf_select__)"
local selected="$(__fzf_select__ "$@")"
READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}"
READLINE_POINT=$(( READLINE_POINT + ${#selected} ))
}
Expand Down

0 comments on commit 3312cf5

Please sign in to comment.