Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

One $HISTFILE to rule them all



I assume that most of you are already familiar with Dropbox (www.getdropbox.com)

If not, the short version is this: 2gb of diskspace, free,
automatically sync'd across multiple computers (Win, Mac, Ubuntu,
perhaps other Un*x variants as well). Backed by Amazon.com's S3
service.

SHAMELESS PLUG: If you haven't signed up yet, use this link

http://tr.im/dropboxsignup
aka
https://www.getdropbox.com/referrals/NTE4NDE0OQ~~

and you'll get 2.25GB instead of 2.0GB (and I get some extra space too)

</commercial> :-)

Ok, now:

One of the great features of Dropbox for me has been syncing my shell
scripts folder. I can now put them all in one place, edit them on any
computer, and have them all updated automatically. (I explained how I
set this up here:
http://tntluoma.com/shell-scripts/dropbox-bin/ )

Then I realized that I could sync my .zshenv file using 'ln -s'

ln -s ~/Dropbox/Zsh/Env.txt ~/.zshenv

My latest question is this:

Is there a way for me to change my $HISTFILE to something like
~/Dropbox/Zsh/History.txt and have zsh save the history from any shell
on any computer to the same file?

I wasn't sure how $HISTFILE would react to being written to from
several different places.

Here is what I currently have set:

$ fgrep -i hist ~/.zshenv|sort
HISTFILE=$HOME/.zhistory
HISTSIZE=SAVEHIST=99999
setopt APPEND_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_FCNTL_LOCK
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
setopt HIST_SAVE_NO_DUPS
setopt HIST_VERIFY
setopt INC_APPEND_HISTORY

Note: I like I really big history file, because I often find good
stuff in there later that I didn't realize (at the time) I would want
again later.

I just added some of these after reading 'zshall'

If you have any suggestions, warnings, etc, I would very much like to
hear them :-)

Thanks!

TjL



Messages sorted by: Reverse Date, Date, Thread, Author