Skip to content

Instantly share code, notes, and snippets.

@matthewmccullough
Created January 20, 2011 00:00
Show Gist options
  • Save matthewmccullough/787142 to your computer and use it in GitHub Desktop.
Save matthewmccullough/787142 to your computer and use it in GitHub Desktop.
A configuration to maintain history across sessions and share it across terminals in ZShell
##############################################################################
# History Configuration
##############################################################################
HISTSIZE=5000 #How many lines of history to keep in memory
HISTFILE=~/.zsh_history #Where to save history to disk
SAVEHIST=5000 #Number of history entries to save to disk
#HISTDUP=erase #Erase duplicates in the history file
setopt appendhistory #Append history to the history file (no overwriting)
setopt sharehistory #Share history across terminals
setopt incappendhistory #Immediately append to the history file, not just when a term is killed
@joaotavora
Copy link

I just divorced myself from the overhead of oh-my-zsh

And I did exactly the same with zprezto, yay vanilla

@tejeshvaish
Copy link

I switched from bash to zsh

@jimboelterchtr
Copy link

This totally made my day, thank you!

@zachliu
Copy link

zachliu commented Oct 28, 2022

for zinit users:

zinit snippet OMZP::history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment