docs: update readme
This commit is contained in:
parent
12ac4b86c2
commit
f538b45e84
13
README.md
13
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue