summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2022-11-05 14:39:31 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2022-11-05 14:39:31 -0500
commitfcb1d4fa276bb1544d3ad47c27931c63fde3d297 (patch)
treef4d5bedd220d6128f21e0360d87e35cd123c1af0
parent46a49ab7bd980a85c4fd772b74639a87fc153b0c (diff)
downloaddotconfig-fcb1d4fa276bb1544d3ad47c27931c63fde3d297.tar.xz
dotconfig-fcb1d4fa276bb1544d3ad47c27931c63fde3d297.zip
make nicegit better
-rwxr-xr-x[-rw-r--r--]zsh/zscripts/nicegit.zsh15
-rwxr-xr-xzsh/zscripts/shortcuts.zsh12
2 files changed, 26 insertions, 1 deletions
diff --git a/zsh/zscripts/nicegit.zsh b/zsh/zscripts/nicegit.zsh
index 5aab8e0..faa7987 100644..100755
--- a/zsh/zscripts/nicegit.zsh
+++ b/zsh/zscripts/nicegit.zsh
@@ -3,11 +3,16 @@
alias \
ga="git add" \
gpl="git pull" \
- gps="git push" \
+ gph="git push" \
gl="git log" \
function gc() {
+ if ! __is_diff; then
+ echo "Nothing to commit, working tree clean"
+ return
+ fi
+
if [[ "$@" != "" ]]; then
commit="$@"
else
@@ -15,3 +20,11 @@ function gc() {
fi
git commit -m "$commit"
}
+
+function __is_diff() {
+ ! git diff --quiet HEAD $REF -- $DIR
+}
+
+function gdf() {
+ __is_diff && git diff HEAD $RED -- $DIR || echo "Repo is unchanged"
+}
diff --git a/zsh/zscripts/shortcuts.zsh b/zsh/zscripts/shortcuts.zsh
new file mode 100755
index 0000000..fb34337
--- /dev/null
+++ b/zsh/zscripts/shortcuts.zsh
@@ -0,0 +1,12 @@
+#!/usr/bin/env zsh
+
+# Quick navigate to directories / open specific files
+alias \
+ cdc="cd ~/.local/src/programs" \
+ cds="cd ~/.local/bin" \
+ cdw="cd ~/.local/src/sites" \
+ hw="cd ~/docs/school" \
+ vrc="vim ~/.config/nvim/init.vim" \
+ xrc="cd ~/.config/x11" \
+ zrc="cd ~/.config/zsh" \
+