refactor!: rename the term select
to toggle
to reserve select
for future use
#1773
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
There has always been a missing feature in Yazi: typing
.mp3$
to select all MP3 files.Some users who migrated from other terminal file managers really miss this feature and have asked me about it several times.
My usual suggestion is to use the filter (by pressing
f
), type.mp3$
, then press<C-a>
to select all, and finallyEsc
to exit.However, this is not very user-friendly, as it involves extra steps like
<C-a>
to select all andEsc
to restore the file list layout from the "filter view".Although it's easy to implement this with a plugin by combining those steps, but I believe this is an important feature that Yazi should have built-in.
Unfortunately, I couldn't come up with a better command name than
select
to support it, which is already in use. So, this PR renames the existingselect
command totoggle
and simplifies it, keeping it available for this new feature added soon in the feature.Renamed
select
command totoggle
The
toggle
andtoggle_all
commands both have optionalon
andoff
parameters. If they are not provided, the commands simply invert the current state.Renamed the
select
component topick
componentYazi's design philosophy is to use different terms for different things to minimize confusion as much as possible — if the terms are different, they are likely referring to different things, preventing users from associating them as the same.
During the refactoring, I realized that the
select
component used for "Open with" also shared the termselect
, this PR renames it to thepick
component as well.