Yet another fzf plugin for Fish.
Unlike the others, this plugin tries to pack as much as possible into a single "do what I mean" shortcut. Edit a file? cd to a directory? Just insert it into the command line? Many things like this can be determined from context.
Run make install, or use Fisher:
fisher install mk12/fish-fzfThe main keybinding is CtrlO:
- CtrlO calls
__fzf_insert fileto search files.
For convenience, you can also jump directly into a different mode with these keybindings:
- CtrlQ calls
__fzf_insert directoryto search directories. - AltZ calls
__fzf_insert zto search z directories.
This plugin also offers a fzf version of history-search-backward:
- CtrlR calls
__fzf_historyto search command history.
Press CtrlO to launch fzf.
If you've already typed a path, or part of one, it will start there. Otherwise, it will start in the working directoy. Within fzf, you get these keybindings:
- Enter selects a result.
- Tab selects multiple results.
- CtrlO switches to searching files.
- CtrlQ switches to searching directories.
- AltZ switches to searching z directories.
- Alt↑ goes up to the parent directory.
- Alt↓ goes into the current item's directory.
- AltH goes to your home directory.
- Alt. toggles showing hidden paths.
- AltI toggles showing ignored paths.
When you make a selection, it will normally be inserted in the command line. But if the command line was empty before and you only selected one item:
- If it's a directory,
cdto it. - If it's a file, open it with
$EDITOR.
To prevent this, use AltEnter.
© 2022 Mitchell Kember
Fish FZF is available under the MIT License; see LICENSE for details.