From f8d1cf1a57bcbc4c7a3d3b7359723b50e7957aee Mon Sep 17 00:00:00 2001
From: Daniel Lundin <daniel@arity.se>
Date: Sun, 2 Jul 2023 16:34:21 +0200
Subject: [PATCH] zsh: add zsh-abbr

---
 .config/zsh-abbr/abbr-jj            | 6 ++++++
 .config/zsh-abbr/user-abbreviations | 9 +++++++++
 .zshrc                              | 2 ++
 3 files changed, 17 insertions(+)
 create mode 100644 .config/zsh-abbr/abbr-jj
 create mode 100644 .config/zsh-abbr/user-abbreviations

diff --git a/.config/zsh-abbr/abbr-jj b/.config/zsh-abbr/abbr-jj
new file mode 100644
index 0000000..29e638f
--- /dev/null
+++ b/.config/zsh-abbr/abbr-jj
@@ -0,0 +1,6 @@
+abbr add -S --force "c"="jj commit"
+abbr add -S --force "new"="jj new main"
+abbr add -S --force "p"="jj git push"
+abbr add -S --force "s"="jj status"
+abbr add -S --force "sl"="jj log --ignore-working-copy"
+abbr add -S --force "d"="jj show"
diff --git a/.config/zsh-abbr/user-abbreviations b/.config/zsh-abbr/user-abbreviations
new file mode 100644
index 0000000..3b32d17
--- /dev/null
+++ b/.config/zsh-abbr/user-abbreviations
@@ -0,0 +1,9 @@
+abbr "abbr-jj"="source ~/.config/zsh-abbr/abbr-jj"
+abbr "c"="git commit"
+abbr "d"="git diff --stat -p -C --color-words"
+abbr "g"="git"
+abbr "k"="kubectl"
+abbr "new"="git checkout --detach main"
+abbr "p"="git push"
+abbr "s"="git status"
+abbr "sl"="git sl"
diff --git a/.zshrc b/.zshrc
index 138d28c..cc414c6 100644
--- a/.zshrc
+++ b/.zshrc
@@ -19,6 +19,8 @@ zi load zsh-users/zsh-history-substring-search
 zi ice wait lucid
 zi load nix-community/nix-zsh-completions
 zi ice wait lucid
+zi load olets/zsh-abbr
+zi ice wait lucid
 zi snippet https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/shrink-path/shrink-path.plugin.zsh
 
 zstyle ':completion:*' use-cache on