-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fzf_configure_bindings] update help message #267
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
677c54e
update help for configure bindings
PatrickF1 47bd143
clearer language
PatrickF1 9e2c606
use word cleanly and safely
PatrickF1 79dff99
rewrite a lot
PatrickF1 1f32fad
shorten
PatrickF1 9e0dbb1
shorten more and use even more precise grammar
PatrickF1 8e6919e
Merge branch 'main' into help
PatrickF1 5f3cd41
see also not more, explain it's already called on startup
PatrickF1 257197c
put equal sign outside of brackets in usage
PatrickF1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
function _fzf_configure_bindings_help --description "Prints the help message for fzf_configure_bindings." | ||
echo "\ | ||
USAGE: | ||
fzf_configure_bindings [--FEATURE[=KEY_SEQUENCE]...] | ||
fzf_configure_bindings [--FEATURE=[KEY_SEQUENCE]...] | ||
|
||
DESCRIPTION | ||
By default, fzf_configure_bindings installs mnemonic key bindings for fzf.fish's features. Each | ||
feature's binding can be customized through a corresponding namesake option: | ||
FEATURE | MNEMONIC KEY SEQUENCE | CORRESPONDING OPTION | ||
fzf_configure_bindings installs key bindings for fzf.fish's features and erases any bindings it | ||
previously installed. It installs bindings for both default and insert modes. fzf.fish executes | ||
it without options on fish startup to install the out-of-the-box key bindings. | ||
|
||
By default, feature are bound to a mnemonic key sequence, shown below. Each feature's binding | ||
can be configured using a namesake corresponding option: | ||
FEATURE | DEFAULT KEY SEQUENCE | CORRESPONDING OPTION | ||
Search directory | Ctrl+Alt+F (F for file) | --directory | ||
Search git log | Ctrl+Alt+L (L for log) | --git_log | ||
Search git status | Ctrl+Alt+S (S for status) | --git_status | ||
Search history | Ctrl+R (R for reverse) | --history | ||
Search variables | Ctrl+V (V for variable) | --variables | ||
Search processes | Ctrl+Alt+P (P for process) | --processes | ||
An option with a key sequence value overrides the binding for its feature, while an option | ||
without a value disables the binding. A feature that is not customized retains its default | ||
menomonic binding specified above. Key bindings are installed for default and insert modes. | ||
Override a feature's binding by specifying its corresponding option with the desired key | ||
sequence. Disable a feature's binding by specifying its corresponding option with no value. | ||
|
||
In terms of validation, fzf_configure_bindings fails if passed unknown options. Furthermore, it | ||
expects an equals sign between an option's name and value. However, it does not validate key | ||
sequences. Rather, consider using fish_key_reader to manually validate them. | ||
Because fzf_configure_bindings erases bindings it previously installed, it can be cleanly | ||
executed multiple times. Once the desired fzf_configure_bindings command has been found, add it | ||
to your config.fish in order to persist the customized bindings. | ||
|
||
In terms of experimentation, fzf_configure_bindings erases any bindings it previously installed | ||
before installing new ones so it can be repeatedly executed in the same fish session without | ||
problem. Once the desired fzf_configure_bindings command has been found, add it to config.fish | ||
in order to persist the bindings. | ||
In terms of validation, fzf_configure_bindings fails if passed unknown options. It expects an | ||
equals sign between an option's name and value. However, it does not validate key sequences. | ||
|
||
The -h and --help options print this help message. | ||
Pass -h or --help to print this help message and exit. | ||
|
||
EXAMPLES | ||
Install the default mnemonic bindings | ||
\$ fzf_configure_bindings | ||
Install the default bindings but override git log's binding to Ctrl+G | ||
\$ fzf_configure_bindings --git_log=\cg | ||
Install the default bindings but leave search history unbound | ||
\$ fzf_configure_bindings --history | ||
Alternative style of disabling search history | ||
Default bindings but bind search directory to Ctrl+F and search variables to Ctrl+Alt+V | ||
\$ fzf_configure_bindings --directory=\cf --variables=\e\cv | ||
Default bindings but disable search history | ||
\$ fzf_configure_bindings --history= | ||
An agglomeration of all the options | ||
\$ fzf_configure_bindings --git_status=\cg --history=\ch --variables --directory --git_log | ||
An agglomeration of different options | ||
\$ fzf_configure_bindings --git_status=\cg --history=\ch --variables= --processes= | ||
|
||
SEE Also | ||
To learn more about fish key bindings, see bind(1) and fish_key_reader(1). | ||
" | ||
end |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One notable change is I think
--feature=
is a better convention than--feature
to disable a feature, so I removed this example and updated the usage to reflect that.