This plugin is archived as I am now using PatrickF1/fzf.fish instead of jethrokuan/fzf, and the changes here are less useful than the core functionality provided by Patrick’s plug-in.
A quick plugin for fish shell that provides some useful default configuration options for fzf over and above jethrokuan/fzf.
Install with [Fisher][] (recommended):
# Fisher 3.x
fisher add halostatue/fish-fzf
# Fisher 4.0+: Dependencies must be declared explicitly
fisher install jethrokuan/fzf halostatue/fish-fzf
Not using a package manager?
Copy conf.d/*.fish
to your fish configuration directory preserving the
directory structure.
- [fish][] 3.0+
- jethrokuan/fzf
- fzf
-
If
fzf
is installed in$HOME/.fzf
, adds$HOME/.fzf/bin
to$fish_user_paths
. -
Sets a useful global value for
$FZF_FIND_FILE_COMMAND
if one of [pt (the platinum searcher)][], [rg (ripgrep)][], or [ag (the silver searcher)][] are installed. -
Sets a useful global value for
$FZF_FIND_FILE_OPTS
that will take advantage of [bat][], [highlight][], rougify, coderay,cat
, ortree
. -
Sets a useful global value for
$FZF_CD_OPTS
usingtree
. -
Sets a useful global value for
$FZF_REVERSE_ISEARCH_OPTS
offering a hidden preview activated with?
.
None of the included completion widgets are bound by default.
Use fzf to select a parent directory from the current directory.
Use fzf to choose a directory that has previously been visited.
Run the current command-line which produces output piped through fzf. Replace the command-line with the unescaped selection.
Most of these functions are translated to fish from zsh implementations from
the fzf wiki [examples][]. Many of the completion widgets in
conf.d/halostatue_fish_fzf.fish
are from the fzf wiki [Fish examples][].
Checkout a git branch (including remote branches), sorted by the most recent commit, limit of the last 30 branches.
fbr
Checkout a git branch or tag. If -p
or --preview
is provided, displays a
preview showing the commits between the tag/branch and HEAD.
fco [-p|--preview]
Open the selected file with the default editor, bypassing the fuzzy finder if there’s only one match and exiting if there’s no match.
fe [PATTERN]
Open the selected file with open
(when Ctrl-O
is pressed in the finder) or
the default editor (when Ctrl-E
or Enter
are pressed in the finder).
fo [PATTERN]
Shows processes that your user can kill and kills the selected process.
fkill
Browse commits. With -p
or --preview
, shows a preview.
fshow
fshow -p
A git stash browser. Enter
shows the contents of the stash; Ctrl-D
shows a
diff of the stash against your current HEAD; Ctrl-B
checks the stash out as
a branch, for easier merging.
[]: https://github.com/halostatue/fish-fzf/releases [Fisher]: https://github.com/jorgebucaran/fisher [fish]: https://github.com/fish-shell/fish-shell [pt (the platinum searchr)]: https://github.com/monochromegane/the_platinum_searcher [rg (ripgrep)]: https://github.com/BurntSushi/ripgrep [ag (the silver searcher)]: https://github.com/ggreer/the_silver_searcher [highlight]: http://www.andre-simon.de/doku/highlight/en/highlight.php [bat]: https://github.com/sharkdp/bat [examples]: https://github.com/junegunn/fzf/wiki/Examples [Fish examples]: https://github.com/junegunn/fzf/wiki/Examples-(fish)