Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oh-my-zsh disable lib history.zsh

Tags:

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.

like image 904
Arnold Roa Avatar asked Feb 16 '14 15:02

Arnold Roa


People also ask

How do I turn off history on ZSH?

enablehistory just unsets function set by previous alias. Show activity on this post. Try configuring your ZSH setup to run a postexec function that empties/deletes your .

How do I stop oh my ZSH update?

You have to add DISABLE_AUTO_UPDATE="true" on your . zshrc before the source $ZSH/oh-my-zsh.sh line. By doing so, oh-my-zsh will just skip the update checking script.


2 Answers

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 ;) )

like image 58
jcsd Avatar answered Sep 26 '22 10:09

jcsd


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 
like image 43
mattmc3 Avatar answered Sep 23 '22 10:09

mattmc3