From 88f4c16755d8fb53e55adec84d60d4aeaf1e7d91 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 17 Mar 2024 03:06:48 -0400 Subject: Make it possible to disable `Ctrl+T` / `Alt+C` / completions (#3678) This makes it possible to skip one of the above key bindings or completions by setting a variable to an empty string. For example, FZF_CTRL_T_COMMAND= FZF_ALT_C_COMMAND= \ eval "$(fzf --zsh)" Co-authored-by: Junegunn Choi --- shell/key-bindings.fish | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'shell/key-bindings.fish') diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish index 51ddcc0d..6e62c59c 100644 --- a/shell/key-bindings.fish +++ b/shell/key-bindings.fish @@ -104,14 +104,22 @@ function fzf_key_bindings end end - bind \ct fzf-file-widget bind \cr fzf-history-widget - bind \ec fzf-cd-widget + if not set -q FZF_CTRL_T_COMMAND; or test -n "$FZF_CTRL_T_COMMAND" + bind \ct fzf-file-widget + end + if not set -q FZF_ALT_C_COMMAND; or test -n "$FZF_ALT_C_COMMAND" + bind \ec fzf-cd-widget + end if bind -M insert > /dev/null 2>&1 - bind -M insert \ct fzf-file-widget bind -M insert \cr fzf-history-widget - bind -M insert \ec fzf-cd-widget + if not set -q FZF_CTRL_T_COMMAND; or test -n "$FZF_CTRL_T_COMMAND" + bind -M insert \ct fzf-file-widget + end + if not set -q FZF_ALT_C_COMMAND; or test -n "$FZF_ALT_C_COMMAND" + bind -M insert \ec fzf-cd-widget + end end function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath, fzf query, and optional -option= prefix' -- cgit v1.2.3