Releases: PatrickF1/fzf.fish
v5.7
v5.6
Added
- Show a preview of the entire command in history search (#125 - @ovv). This is very useful when dealing with long commands, which get truncated in the fzf finder; or mutli-line commands, for which the whitespace gets messed up.
- The
fd
execution is now configurable. Users can now pass custom options tofd
through thefzf_fd_opts
variable. A backwards incompatible change included in this is that hidden files are no longer searched by default (#126).
Fixed
- Ensure variables set by conf.d/fzf.fish are global and update uninstaller to actually uninstall everything (#122 - @etcusrvar). This was a bug for people who source fzf.fish's config file.
- Remove leading underscores from
fzf_search_vars_cmd
, which is mean to be utilized by the end user. (f14a1d3)
v5.5
Configure the preview directory command (#120)
To acquiesce to the popularity and diversity of ls alternatives (e.g. https://github.com/ogham/exa, https://github.com/Peltoche/lsd, https://github.com/athityakumar/colorls, tree, all of which have many different options to configure them), I have finally decided to make the command used to preview directories configurable. Users can place their desired command in fzf_preview_dir_cmd and fzf.fish will use it.
Bug fix for the search file feature (#119 - @ovv )
If the file path already starts with . or /, which can happen if such a path was used as the base directory, then don't prepend ./.
Without such logic, the path becomes invalid. For example:
- if the current token is
/etc/
and you selectsystemd
, you end up with'.//etc/systemd'
- if the current token is
~/
and you selectDesktop
, you end up with'./~/desktop'
v5.4
This release comes with only two minor bug fixes. However, there are also multiple process and non-feature changes that Iβd like to formally announce. They will optimize the feedback loop and accelerate future improvements to hopefully attract more contributors to this project π₯³.
Bugs fixed
- Tilde (~) from current token not expanding for search files (#109 - @kidonng)
- Search shell variables returning status code 0 when actually, it errored (#82)
Non-feature improvements
Continuous integration
fzf.fish
now has automated test and continuous integration now! Itβs hard to understate how excited I am about this! When I first started fzf.fish
and pushed a number of bugs because I didnβt have automated tests, I was so frustrated but didnβt think it was possible to test a shell workflow involving user input into an external program. But since then, a confluence of technologies have emerged to made it feasible: GitHub Actions, fishtape, clownfish, and fzfβs built in scripting mode.
Special thanks to @jorgebucaran and @IlanCosman for help in accomplishing this major milestone!
GitHub Wiki opened
The troubleshooting and prior art sections of the readme has moved to the Wiki.
The goal is to make maintaining Q&A style help a lightweight process. Having to commit to master is troublesome and people likely don't care to see those changes when they check the commit log. Furthermore, I have been hindered from writing a more in-depth documentation but I didn't want the readme to be hard to scroll through. Moving these sections to the readme will resolve that tension.
Non-bug issues -> GitHub Discussions
- Most non-bug issues have been moved to the repo discussions (so if you can't find your old issue, try the discussions).
- Additionally, the issue template choose has been configured to direct all future questions or feature requests to the discussions.
- Bug reports are now the only type of issue that users can file. I added a template to help make this more obvious and collect higher quality bug reports.
The motivation of this change is to make common questions and feature ideas more discoverable and help coalesce discussion on them, which will reduce the amount of work I have to do addressing common questions and features. This will also help me get a better picture overall of how users use fzf.fish, leading to more informed decisions.
The issue template chooser was copied from starship. Thanks @matchai for help with pre-populating discussions with a category.
v5.3
Changed
Changed fzf's multi-select marker to * by default. This makes the multi-select marker more distinguishable from the pointer, since both default to >
. (07eb7eb)
Fixed
Fixed bug in extracting variable values containing |
(#81)
# Before fix
$ set variable "a | b | c | d"
$ __fzf_extract_var_info variable (set --show | psub)
set in global scope, unexported, with 1 elements
[1] d
# After fix
$ set variable "a | b | c | d"
$ __fzf_extract_var_info variable (set --show | psub)
set in global scope, unexported, with 1 elements
[1] a | b | c | d
This fix also comes with the first batch of automated tests!
Prevent arguments from being interpreted as options (#80)
Examples where fzf.fish would error:
- the cursor is over the token --something when the user executes search files
- the selected changed path from git status is -folder
This SQL-injection-like bug has been fixed by using --
where necessary to make sure Fish builtins interpret user input as positional arguments rather than options.
Thanks @kidonng for contributing this fix!
v5.2
Making quick open more flexible (#76 - @kidonng)
Before, fzf.fish would only prepend ./
if the command line was empty and the selected path is a directory.
Now, prepend ./ gets prepended even if the user has some input and even if the selected directory is not a directory so that
- if the path is an executable, the user can hit Enter one more time to immediately execute it
- if the path is a directory, the user can hit Enter one more time to immediately cd into it
Fixed multi-line command bug (8bacfb3)
Before, selecting a multi-line command when using the search command history feature would result in the command lined being replaced with only the top line of the selected command.
For example, selecting this command from history
function example
echo "This is just an example"
end
would result in the command line becoming only
function example
The bug is now fixed so users can recall the entirety of multi-line commands from history.
v5.1
Ability to specify from which directory to search (#75)
- This new behavior allows the user to choose to search a directory other than the current directory. If the current token is a directory and it has a trailing slash (e.g.
vim functions/<CURSOR>
), then we assume the user wants to search for files in that directory. - This can be useful when the current directory contains large subdirectories (e.g. on macOS, the home directory contains
~/Library
, which is very large). Moreover, it also allows searching a parent or sibling directory by using../
(e.g.../Downloads/<CURSOR>
). - What's great is that this behavior complements tab completion. When a user wants to access a file in a subdirectory, they may start typing the name of the directory and hit TAB. When tab completion writes out the directory's path, it will already append a trailing slash for the user, allowing the user to quickly execute the search files feature and search for the file in a more narrow scope.
Credits for @kidonng for writing most of the code and @paddor and @imr0 for pushing the idea!
v5.0
Version 5 ships with new improved behavior that is more intuitive, easy to learn, and makes typing commands much faster! Big thanks to @kidonng who came up with all of these features and worked tirelessly with me until they were perfected.
For users who use custom key bindings, please read the Migrating
section at the bottom.
Change directory without typing cd (#72)
To change directories faster without typing cd
, start with an empty command line and trigger the find file feature (Ctrl+F by default). After you select the desired directory, fzf.fish will automatically prepends a ./
to the directory so that your command line becomes ./directory_path
. Then, hit Enter one more time to cd there.
This works because Fish treats directory names starting with a .
as an implicit cd:
the shell will attempt to change directory without requiring cd if the name of a directory is provided (starting with ., / or ~, or ending with /).
Use the current token to pre-populate the fzf query, replace it with the selection (#73)
What is "the current token"? It's the word that under the cursor. e.g. for
cat filepath<CURSOR>
, current token =filepath
. If your cursor is not touching any words (e.g.cat filepath <CURSOR>
or `vim file), then there is no current token and none of the behavior below applies.
Now, all functions will
- use the current token (the word that is under the cursor) to pre-populate the fzf query, which will make searching faster
- replace the current token with the selection (if there is a current token), which will reduce hassle. The previous behavior of simply inserting the selection at the cursor meant that if there was a current token when the user triggered fzf.fish, that token would become mashed together with their first selection. By replacing the current token instead, users no longer have to go back and delete it to clean up their command.
A special case was made for searching for shell variables. If the current token begins with a $
, the $
is not overwritten when replacing the current token with the selected variable.
Shell variables search much more powerful (#71)
- Shell variable previews now use
set --show
which- shows which scopes the variable is defined in
- puts each element of the variable on its own line with the index number to make list variables much more readable
- You can know search for and inspect every single variable set in your current shell environment and scope, even if the variables are local and unexported. This is actually a major improvement as well as a bug fix. Before, search variables function actually used the variables from a different scope and the values form a different fish shell, so local variables were missing or variables had the wrong value. This is a problem if say, you wanted to inspect a local variable or inspect
$status
. Now, you will be able to see all the variables exactly as they are at the time you triggered fzf.fish. $history
is now excluded from the variables that can be searched for technical reasons, but also to encourage usage of the search command history feature.
Note: This change is backwards incompatible for users who set their own key binding. See the Migrating
section below.
Other changes
- Use
MM-DD
for the history date format, which is more readable and standard (#74) - minor performance improvements made by reducing the number of calls to
commandline
(part of #73)
Migrating
If you do not use custom key bindings, there is nothing you need to do to upgrade to v5. However, if you do, you need to update your key binding to call __fzf_search_current_dir
with two new arguments:
# If you use custom key bindings, change this...
bind \cv '__fzf_search_current_dir'
bind --mode insert \cv '__fzf_search_current_dir'
# ...to this...
set --local search_vars_cmd '__fzf_search_shell_variables (set --show | psub) (set --names | psub)'
bind \cv $search_vars_cmd
bind --mode insert \cv $search_vars_cmd
See conf.d/fzf.fish for more details.