mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-19 17:13:42 -05:00
Created Fuzzy completion (markdown)
32
Fuzzy-completion.md
Normal file
32
Fuzzy-completion.md
Normal file
@@ -0,0 +1,32 @@
|
||||
## zsh
|
||||
|
||||
### Dedicated completion key
|
||||
|
||||
Instead of using `TAB` key with a trigger sequence, you can assign a dedicated key for fuzzy completion while retaining the default behavior of `TAB` key.
|
||||
|
||||
Add the following lines *after* `source ~/.fzf.zsh`
|
||||
|
||||
```sh
|
||||
export FZF_COMPLETION_TRIGGER=''
|
||||
bindkey '^T' fzf-completion
|
||||
bindkey '^I' $fzf_default_completion
|
||||
```
|
||||
|
||||
Then `CTRL-T` will trigger context-aware fuzzy completion.
|
||||
|
||||
### Caveats
|
||||
|
||||
#### `setopt vi`
|
||||
|
||||
`setopt vi` resets `TAB` key binding, so unless you've assigned a dedicated key, fuzzy completion will become unavailable.
|
||||
|
||||
```sh
|
||||
> bindkey '^I'
|
||||
"^I" fzf-completion
|
||||
|
||||
> setopt vi
|
||||
> bindkey '^I'
|
||||
"^I" expand-or-complete
|
||||
```
|
||||
|
||||
So make sure that `.fzf.zsh` (or `completion.zsh`) is sourced after `setopt vi`.
|
||||
Reference in New Issue
Block a user