From f538b45e8466f24560781744e2cf0902d12bc74f Mon Sep 17 00:00:00 2001 From: Viktor Varland Date: Fri, 28 Feb 2025 16:01:58 +0100 Subject: [PATCH] docs: update readme --- README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 53a6a1b..57f3d6a 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,27 @@ # shell-history -## setup - - - ## zsh `~/.zshrc`: ``` -HISTDB="$HOME/dev/vlv/histdb" +SHISTDB="$HOME/dev/vlv/histdb" SHIST="$HOME/dev/vlv/shell-history" + autoload -Uz compinit promptinit add-zsh-hook _history() { if test "$(id -u)" -ne 0; then echo "$(date --utc --iso-8601=seconds) $(hostname) $(pwd) $(fc -ln -1)" >> \ - $HISTDB/zsh-history-$(date "+%Y-%m-%d").log; + $SHISTDB/zsh-history-$(date "+%Y-%m-%d").log; fi } add-zsh-hook precmd _history _history-sync() { - if [[ -d "$HISTDB" ]]; then + if [[ -d "$SHISTDB" ]]; then () { - pushd -q "$HISTDB" + pushd -q "$SHISTDB" source "$SHIST/sync.sh" popd -q }