Author: "Replace zsh's default completion selection menu with fzf!"
Go to file
2020-01-05 12:50:37 +08:00
.gitignore Fix wd's completion 2019-12-26 04:53:52 +08:00
fzf-tab.plugin.zsh Initial commit 2019-12-25 22:51:05 +08:00
fzf-tab.zsh Don't automatically select the only match 2020-01-03 14:34:32 +08:00
LICENSE Bump LICENSE year 2020-01-05 12:50:37 +08:00
README.md Update README 2019-12-31 16:33:25 +08:00

fzf-tab

Replace zsh's default completion selection menu with fzf!

Install

Manual

First, clone this repository

git clone https://github.com/Aloxaf/fzf-tab ~/somewhere

Then add the following line to your ~/.zshrc

source ~/somewhere/fzf-tab.plugin.zsh

Antigen

antigen bundle Aloxaf/fzf-tab

Zplugin

zplugin light Aloxaf/fzf-tab

Oh-My-Zsh

Clone this repository to your custom directory and then add fzf-tab to your plugin list.

git clone https://github.com/Aloxaf/fzf-tab ~ZSH_CUSTOM/plugins/fzf-tab

Usage

Just press TAB as usual~

Some variables:

  • FZF_TAB_COMMAND: The fuzzy search program

  • FZF_TAB_OPTS: Its parameters

  • FZF_TAB_QUERY: Strategy for generating query strings:

    • input: just like zsh's default behavior
    • prefix: the query string will be the longest common prefix for all matches
    • first: with this flag the fisrt valid query string will be use (default)
    • longest: with this flag the longest valid query string will be use

    The default value is (prefix input first), which means fzf-tab will first try to find the longest common prefix for all matches, if not found it will use your input.

Some commands:

  • disable-fzf-tab: Use it when you come across some bugs

  • enable-fzf-tab: Use it when fzf-tab doesn't initialize properly.

Difference from other plugins

fzf-tab doesn't do "complete", it just shows your results of the default completion system.

So it works EVERYWHERE (variables, function names, directory stack, in-word completion, etc.). And most of your configure for default completion system is still valid.

Compatibility with other plugins

Some plugins may also bind "^I" to their custom widget, like fzf/shell/completion.zsh or ohmyzsh/lib/completion.zsh.

By default, fzf-tab will call the widget previously bound to "^I" to get the completion list. So there is no problem in most cases, unless fzf-tab is initialized before a plugin which doesn't handle the previous binding properly.

So if you find your fzf-tab doesn't work properly, please make sure it is the last plugin to bind "^I" (If you don't know what I mean, just put it to the end of your plugin list).