summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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" \
+