-
Notifications
You must be signed in to change notification settings - Fork 156
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
Allow users to set keys to be bind, before sourcing the script, using environment variables #123
base: master
Are you sure you want to change the base?
Conversation
README.md
Outdated
|
||
* `HISTORY_SUBSTRING_SEARCH_VICMD_DOWN_KEYS` is a global array that defines the | ||
VI mode keys to be bind to the `history-substring-search-down` command. | ||
Its default value is `('j')`, which is the code for the `j` key. |
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.
I think there's lots of repeating words in the above paragraphs, but I tried to keep the bullets layout. Maybe this could be reformatted as a table?
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.
True. I think the repetition is fine. If you really want to reformat this as a table, please make sure to do the same for all other configuration variables too.
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.
Let's keep the repetition here then, as you're fine with it. I can try a table layout later in a separate PR...
fi | ||
if (( ! $+HISTORY_SUBSTRING_SEARCH_PREFIXED )); then | ||
typeset -g HISTORY_SUBSTRING_SEARCH_PREFIXED='' | ||
fi |
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.
I'm also fixing the issue with WARN_CREATE_GLOBAL, as I commented here: #108 (comment)
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.
PR #119 seems simpler than this implementation. I'm leaning toward merging it instead.
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.
True, that implementation is simpler. Let me update the PR and use that here.
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.
The typeset -g VAR="${VAR:=value}"
construct does not seem correct to me, as is does the assignment twice: at ${VAR:=value}
and also at typeset -g VAR="value"
, so I changed it to what seems more correct.
README.md
Outdated
@@ -161,6 +130,51 @@ default values. | |||
receive globally unique search results only once, then use this | |||
configuration variable, or use `setopt HIST_IGNORE_ALL_DUPS`. | |||
|
|||
The following variables must be overridden before having loaded this script |
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.
I'm hesitant about the "must" requirement here: it's helpful to provide these key arrays to simplify the new-user experience but currently, we don't require users to bind our widgets. They can choose to simply load our plugin and never actually use its functionality. This kind of basic "null" use-case should be preserved, I feel.
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.
Okay, so all these properties will be empty by default, in order to preserve the current "null" use-case. Let me change that and update the README accordingly.
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.
Thanks for this PR. Please see my feedback in the code review.
@sunaku, PR updated. |
This will save users from some common boilerplate code in their own .zshrc file. Fixes zsh-users#107
Nit: CONTROL is such a weird way to spell Ctrl. |
It was being spelled as "Control" and "C" and also "^" before. I tried to unify it to a common format ("CONTROL"), as we have other keys in all caps too (e.g. "UP", "DOWN") in the same document. Fun fact: my keycaps actually spell it as "Control" :- ) @sunaku, what do you prefer? |
This will save users from some common boilerplate code in their own
.zshrc
file.Fixes #107