diff options
| author | Eli Barzilay <eli@barzilay.org> | 2024-03-17 03:06:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-17 16:06:48 +0900 |
| commit | 88f4c16755d8fb53e55adec84d60d4aeaf1e7d91 (patch) | |
| tree | 2b33afcecdf048d90969091d7830014a89825b53 /shell/key-bindings.zsh | |
| parent | c7ee071efa0f988ba9613166798afc4b300ce761 (diff) | |
| download | fzf-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.zsh')
| -rw-r--r-- | shell/key-bindings.zsh | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh index a3699add..51aa6ea0 100644 --- a/shell/key-bindings.zsh +++ b/shell/key-bindings.zsh @@ -62,10 +62,12 @@ fzf-file-widget() { zle reset-prompt return $ret } -zle -N fzf-file-widget -bindkey -M emacs '^T' fzf-file-widget -bindkey -M vicmd '^T' fzf-file-widget -bindkey -M viins '^T' fzf-file-widget +if [[ "${FZF_CTRL_T_COMMAND-x}" != "" ]]; then + zle -N fzf-file-widget + bindkey -M emacs '^T' fzf-file-widget + bindkey -M vicmd '^T' fzf-file-widget + bindkey -M viins '^T' fzf-file-widget +fi # ALT-C - cd into the selected directory fzf-cd-widget() { @@ -83,10 +85,12 @@ fzf-cd-widget() { zle reset-prompt return $ret } -zle -N fzf-cd-widget -bindkey -M emacs '\ec' fzf-cd-widget -bindkey -M vicmd '\ec' fzf-cd-widget -bindkey -M viins '\ec' fzf-cd-widget +if [[ "${FZF_ALT_C_COMMAND-x}" != "" ]]; then + zle -N fzf-cd-widget + bindkey -M emacs '\ec' fzf-cd-widget + bindkey -M vicmd '\ec' fzf-cd-widget + bindkey -M viins '\ec' fzf-cd-widget +fi # CTRL-R - Paste the selected command from history into the command line fzf-history-widget() { |
