Useful usage
histdb-top
will show the most commonly used commands
Installing zsh-histdb in zprezto
Add zsh-histdb
in zstyle â:prezto:loadâ in zpreztroc file:
For macOS add this line before modules are sourced, I chose right above the zstyle line in zpretorc:
HISTDB_TABULATE_CMD=(sed -e $'s/\x1f/\t/g')
Importing existing commands
npx histdbimport
Setting up sync
zsh-histdb uses git to synchronize zsh commands across
machines. This is pretty handy as you can pull up commands used
elsewhere. The initial setup is a bit finicky and I made mistakes, my
recommended approach would be to start by running the sync command on
the machine with the most command history (maybe use import above). It
will initialize a git repo. Now manually you should setup the remote
repo in ~/.histdb
(recommended the remote be private!), and re-run
sync, you know have your main branch. On each subsequent machine copy
your .histdb directory to a backup location. Run sync to setup the git
repo at .histdb
, manually setup the remote and pull down. Copy your db
from your backup into .histdb, run sync again and it will handle the
merge.