summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorEllie Huxtable <e@elm.sh>2021-02-13 20:54:35 +0000
committerEllie Huxtable <e@elm.sh>2021-02-13 20:55:06 +0000
commitfbaeedbba441a89be7778be5cffa89a421007d17 (patch)
tree125bb90ef0452005d4c5690e1d9f3bddb34025cb /README.md
parentccdaa21fc6471faaf6def79f9ad7a80a5993dc13 (diff)
Minor fixes
Diffstat (limited to 'README.md')
-rw-r--r--README.md48
1 files changed, 48 insertions, 0 deletions
diff --git a/README.md b/README.md
index 6739500a..b70820ad 100644
--- a/README.md
+++ b/README.md
@@ -17,3 +17,51 @@ As well as the expected command, this stores
- hostname
- time
- a unique session ID
+
+## Install
+
+`atuin` needs a recent version of Rust + Cargo! It's best to use rustup for.
+
+```
+cargo install atuin
+```
+
+and then add this to your ~/.zshrc
+
+```
+export ATUIN_SESSION=$(atuin uuid)
+
+_atuin_preexec(){
+ id=$(atuin history start $1)
+ export ATUIN_HISTORY_ID="$id"
+}
+
+_atuin_precmd(){
+ local EXIT="$?"
+
+ [[ -z "${ATUIN_HISTORY_ID}" ]] && return
+
+ atuin history end $ATUIN_HISTORY_ID --exit $EXIT
+}
+
+add-zsh-hook preexec _atuin_preexec
+add-zsh-hook precmd _atuin_precmd
+```
+
+We're not replacing anything here, so your default shell history file will still
+be written to!
+
+## Usage
+
+### Import history
+
+```
+atuin import auto # detect shell, then import
+atuin import zsh # specify shell
+```
+
+### List history
+
+```
+atuin history list
+```