Home

Awesome

Fzf

Integrate fzf (command-line fuzzy finder) functionality into Fish. Includes handy functions to:

All functions:

Installation

System Requirements

Install with Fisher:

fisher install jethrokuan/fzf

Quickstart

LegacyNew KeybindingsRemarks
Ctrl-tCtrl-oFind a file.
Ctrl-rCtrl-rSearch through command history.
Alt-cAlt-ccd into sub-directories (recursively searched).
Alt-Shift-cAlt-Shift-ccd into sub-directories, including hidden ones.
Ctrl-oAlt-oOpen a file/dir using default editor ($EDITOR)
Ctrl-gAlt-Shift-oOpen a file/dir using xdg-open or open command

Legacy keybindings are kept by default, but these have conflict with key bindings in Fish 2.4.0. If you want to use the new keybindings, ƒenter the following into your terminal:

set -U FZF_LEGACY_KEYBINDINGS 0

You can disable default keybindings altogether by running:

set -U FZF_DISABLE_KEYBINDINGS 1

Note: On OS X, <kbd>Alt</kbd>+<kbd>C</kbd> (Option-C) types ç by default. In iTerm2, you can send the right escape sequence with <kbd>Esc</kbd>+<kbd>C</kbd>. If you configure the option key to act as +Esc (iTerm2 Preferences > Profiles > Default > Keys > Left option (⌥) acts as: > +Esc), then <kbd>Alt</kbd>+<kbd>C</kbd> will work for fzf as documented.

Commands

VariableRemarksExample
FZF_FIND_FILE_COMMANDModify the command used to generate the list of filesset -U FZF_FIND_FILE_COMMAND "ag -l --hidden --ignore .git . \$dir 2> /dev/null" or set -U FZF_FIND_FILE_COMMAND "fd --type f . \$dir" ($dir represents the directory being completed)
FZF_CD_COMMANDSimilar to ^Similar to ^
FZF_CD_WITH_HIDDEN_COMMANDSimilar to ^Similar to ^
FZF_OPEN_COMMANDSimilar to ^Similar to ^
FZF_PREVIEW_FILE_CMDModify the command used to generate preview of files.set -U FZF_PREVIEW_FILE_CMD "head -n 10"
FZF_PREVIEW_DIR_CMDModify the command used to generate preview of directories.set -U FZF_PREVIEW_DIR_CMD "ls"

Variables

VariableRemarksExample
FZF_DEFAULT_OPTSDefault options passed to every fzf commandset -U FZF_DEFAULT_OPTS "--height 40"
FZF_FIND_FILE_OPTSPass in additional arguments to the fzf command for find fileset -U FZF_FIND_FILE_OPTS "--reverse --inline-info"
FZF_CD_OPTSSimilar to ^Similar to ^
FZF_CD_WITH_HIDDEN_OPTSSimilar to ^Similar to ^
FZF_REVERSE_ISEARCH_OPTSSimilar to ^Similar to ^
FZF_OPEN_OPTSSimilar to ^Similar to ^
FZF_COMPLETE_OPTSSimilar to ^Similar to ^
FZF_TMUXRuns a tmux-friendly version of fzf instead.set -U FZF_TMUX 1
FZF_ENABLE_OPEN_PREVIEWEnable preview window open command.set -U FZF_ENABLE_OPEN_PREVIEW 1

fzf Tab Completions

This package ships with a fzf widget for fancy tab completions.

Please see the wiki page for details.

Alternatives

License

MIT