summaryrefslogtreecommitdiff
path: root/shell/key-bindings.fish
diff options
context:
space:
mode:
authorEli Barzilay <eli@barzilay.org>2024-03-17 03:06:48 -0400
committerGitHub <noreply@github.com>2024-03-17 16:06:48 +0900
commit88f4c16755d8fb53e55adec84d60d4aeaf1e7d91 (patch)
tree2b33afcecdf048d90969091d7830014a89825b53 /shell/key-bindings.fish
parentc7ee071efa0f988ba9613166798afc4b300ce761 (diff)
downloadfzf-88f4c16755d8fb53e55adec84d60d4aeaf1e7d91.tar.gz
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 <junegunn.c@gmail.com>
Diffstat (limited to 'shell/key-bindings.fish')
-rw-r--r--shell/key-bindings.fish16
1 files changed, 12 insertions, 4 deletions
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'