-
Notifications
You must be signed in to change notification settings - Fork 83
Cookbook
Does the latest version contain bugs or changes that don't jibe with your workflow? Please open a new discussion and we can chat about it. And in the meantime, feel free to use an older version. For example:
# first, uninstall the current version or fisher will complain about conflicting files
fisher remove patrickf1/fzf.fish
# install and freeze the plugin version at v6.5; subsequent calls to `fisher update` will not cause it to update
fisher install patrickf1/[email protected]
I recommend taking a look at ensuing releases to make sure the release you picked doesn't contain not-yet-fixed impactful bugs.
Unfortunately, I have not built in an easy way to check the version of the plugin that you are running (there's not a simple, easy and clean way of doing it and fisher doesn't provide support for it either). The best way is to look at the git history of the repo and check which of the changes have been loaded into your fish shell by running functions
on the function files. For example, the HEAD of v8.1 is this commit and it contains a patch to _fzf_search_processes
. You can run functions _fzf_search_processes
to check if it contains that patch.
- If you're using the default bindings, you can quickly find them by running
fzf_configure_bindings -h
- If you're using custom bindings, you can cat your
config.fish
to see what key sequences you passed tofzf_configure_bindings
- Alternatively, you can just run
bind --user
and inspect them. They should be near the bottom.
From #273.
# set -gx $EDITOR "nvim" # or "vim", or "code", etc.
set fzf_directory_opts --bind "ctrl-o:execute($EDITOR {} &> /dev/tty)
Unlike jethrokuan/fzf, fzf.fish
does not integrate with fzf-tmux. And this is because it requires minimal effort. Simply make the following function accessible, whether by defining it in your config.fish
or in ~/.config/fish/functions/fzf.fish
(so that it will be autoloaded):
function fzf --wraps=fzf --description="Use fzf-tmux if in tmux session"
if set --query TMUX
fzf-tmux $argv
else
command fzf $argv
end
end
From #169. While being able to search the command timestamp can be useful to find the commands executed on a particular day, you may want to exclude it to make use of fzf's prefix matcher ^. To do this, we can take advantage of --nth
option to show the timestamps but exclude them from the search scope:
set --export fzf_history_opts "--nth=4.."
From #193. You can use the --with-nth
flag to transform the input passed into fzf and exclude the timestamp. Pass it into the search history flag using its custom fzf options flag:
set fzf_history_opts --with-nth=4..
While the fzf_preview_file_cmd
only allows you to specify one command to execute to preview files, you can use that to specify a custom function defined by you that can handle different file types. Here is a well-thought-out example submitted by @kidonng. And here is another idea also from @kidonng.
The colors shown in Search Directory are set by fd and then piped to fzf. Fd's colors can be configured by setting the LS_COLORS
variable. See https://github.com/sharkdp/fd#colorized-output and #170.
Use custom fzf options feature to pass --preview=""
to the command. --preview
will override the preview and result in no command being executed to generate the preview.
From #266. Use the --bind
option to assign a keybinding to call the toggle-preview
action. e.g. set fzf_directory_opts --bind ctrl-h:toggle-preview
will allow you to toggle the search file preview on and off using Ctrl+H
. If you want to make the key binding available in all fzf windows, then add that option to FZF_DEFAULT_OPTS
instead.
From #272. You can turn off sorting by best match and only filter with set fzf_history_opts --no-sort
.
This is currently not supported by fzf_configure_bindings
but can be done manually using bind -k
. See #279 for more details.
See #303.