Reputation: 7708
Im using oh-my-zsh and there is a feature that is really annoying me. The history is share for each console. I want to disable that and after a review i found that
.oh-my-zsh/lib/history.zsh
has this:
setopt share_history # share command history data
How should I disable this? I mean, what is the RIGHT way. It is a lib not a plugin, if I edit the file I will not get updates for it.
Upvotes: 27
Views: 7263
Reputation: 2990
If you want to override an internal lib of oh-my-zsh completely, there is a wiki entry for it: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-internals
Basically you would put an empty file at $ZSH_CUSTOM/lib/history.zsh
to disable that lib.
Upvotes: 0
Reputation: 18325
I mean, what is the RIGHT way. It is a lib not a plugin, if I edit the file I will not get updates for it.
The accepted answer is the easiest way, but it bears mentioning that oh-my-zsh lets you override any file or plugin you want by putting it in $ZSH_CUSTOM
- even stuff in lib. If you want to do more than just unsetopt share_history
you could run this:
# $ZSH_CUSTOM should already be automatically set to $ZSH/custom
# but you can customize the location in your ~.zshrc.
# ie: export ZSH_CUSTOM=~/.zsh_custom
# set up lib in omz custom area
mkdir -p $ZSH_CUSTOM/lib
# start off with omz version of the file
cp $ZSH/lib/history.zsh $ZSH_CUSTOM/lib/history.zsh
# edit that file and make it what you want
${EDITOR:-vim} $ZSH_CUSTOM/lib/history.zsh
Upvotes: 2
Reputation: 521
This question is old but anyway:
As you can use setopt
for setting options, you can use unsetopt
to unset them.
Just add
unsetopt share_history
after having sourced $ZSH/oh-my-zsh.sh
(and yes, it's really annoying ;) )
Upvotes: 49