aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-11-03 10:23:44 +0100
committerJohn Ankarström <john@ankarstrom.se>2020-11-03 10:23:44 +0100
commita5bdc9d5f13600f5d0e4a28321e7618cd51963ae (patch)
treea8a4ad951fbb337c27242ef7e2bddd979debdc58
parent9d9616ca52fbaede1dc286f05081f814f8222c94 (diff)
downloadahk-a5bdc9d5f13600f5d0e4a28321e7618cd51963ae.tar.gz
combine file/branch/folder-specific git hotkeys
-rw-r--r--tt.programs.explorer.ahk48
1 files changed, 40 insertions, 8 deletions
diff --git a/tt.programs.explorer.ahk b/tt.programs.explorer.ahk
index 0779f9a..012f7df 100644
--- a/tt.programs.explorer.ahk
+++ b/tt.programs.explorer.ahk
@@ -228,17 +228,49 @@ basename(s)
#IfWinActive ahk_group Explorer
-!a::Run, % "cmd /c cd "qp()" & git add "qip()" && git status & pause"
!c::Run, % "cmd /c cd "qp()" & git commit & pause"
!+c::Run, % "cmd /c cd "qp()" & git commit --amend & pause"
-!f::Run, % "cmd /c cd "qp()" & git diff "qip()" & pause"
-!+f::Run, % "cmd /c cd "qp()" & git diff & pause"
-!i::Run, % "cmd /c cd "qp()" & git diff HEAD~1 HEAD "qip()" & pause"
-!+i::Run, % "cmd /c cd "qp()" & git diff HEAD~1 HEAD & pause"
-!l::Run, % "cmd /c cd "qp()" & git log "qip()" & pause"
-!+l::Run, % "cmd /c cd "qp()" & git log & pause"
!p::Run, % "cmd /c cd "qp()" & git push & pause"
-!r::Run, % "cmd /c cd "qp()" & git reset "qip()" && git status & pause"
!s::Run, % "cmd /c cd "qp()" & git status & pause"
+!a::
+qip := qip()
+if (qip = "")
+ Run, % "cmd /c cd "qp()" & git add . && git status & pause"
+else
+ Run, % "cmd /c cd "qp()" & git add " qip " && git status & pause"
+return
+
+!f::
+qip := qip()
+if (qip = "")
+ Run, % "cmd /c cd "qp()" & git diff & pause"
+else
+ Run, % "cmd /c cd "qp()" & git diff " qip " & pause"
+return
+
+!i::
+qip := qip()
+if (qip = "")
+ Run, % "cmd /c cd "qp()" & git diff HEAD~1 HEAD & pause"
+else
+ Run, % "cmd /c cd "qp()" & git diff HEAD~1 HEAD " qip " & pause"
+return
+
+!l::
+qip := qip()
+if (qip = "")
+ Run, % "cmd /c cd "qp()" & git log & pause"
+else
+ Run, % "cmd /c cd "qp()" & git log " qip " & pause"
+return
+
+!r::
+qip := qip()
+if (qip = "")
+ Run, % "cmd /c cd "qp()" & git reset . && git status & pause"
+else
+ Run, % "cmd /c cd "qp()" & git reset " qip " && git status & pause"
+return
+
#IfWinActive