Closed ericbn closed 7 months ago
Maybe _BORING_COMMANDS
could be deprecated in favor of other zsh options:
"^ "
regexp can be replaced by HIST_IGNORE_SPACE
, which is BTW not set by default in zsh. Code example:
if [[ -o histignorespace && ${cmd} == ' '* ]]; then
return 0
fi
"^histdb"
regexp could be replaced by HIST_NO_STORE
, which is also not set by default in zsh. It's not exactly the same (as HIST_NO_STORE
will actually ignore history
commands), so maybe not a good idea. Code example:
if [[ -o histnostore && ${cmd} == histdb* ]]; then
return 0
fi
"^ls$" "^cd$" "^top$" "^htop$"
regexps can be replaced by setting HISTORY_IGNORE=(ls|cd|top|htop)
, given the changes in this PR. Or "^histdb"
can be included here too, with HISTORY_IGNORE=(ls|cd|histdb*|top|htop)
The pro of using the same parameters as zsh is that both zsh's history and histdb's history will be configured the same way.
Giving it a second thought on HIST_NO_STORE
, to be compatible with what zsh actually does, it might be better to do:
if [[ -o histnostore && ${cmd} == (builtin |)(history( *|)|r( *|)|fc -l*) ]]; then
return 0
fi
I only just saw this and I like it. I will fix it up and merge when I have time, thank you.
Slow turnaround I know but you get what you pay for in opensource software right.
Also set missing local and global variables, so no warning is emitted when WARN_CREATE_GLOBAL is set.