Store your zsh history into a sqlite3 database
github.com
github.com
Sqlite3 is to thank for that, it's a pretty amazing bit of engineering.
: <beginning time>:<elapsed seconds>;<command>
> export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log; fi'
It just logs everything into files per date, have come in handy at times.
https://www.reddit.com/r/zsh/comments/67gsm8/a_thing_i_made_...
j/k This seems pretty cool
Source: Read the source