aboutsummaryrefslogtreecommitdiff
path: root/tt.programs.explorer.ahk
diff options
context:
space:
mode:
Diffstat (limited to 'tt.programs.explorer.ahk')
-rw-r--r--tt.programs.explorer.ahk46
1 files changed, 46 insertions, 0 deletions
diff --git a/tt.programs.explorer.ahk b/tt.programs.explorer.ahk
index 8e2e659..452888b 100644
--- a/tt.programs.explorer.ahk
+++ b/tt.programs.explorer.ahk
@@ -195,3 +195,49 @@ ExplorerFolderView(view, children := false)
SetBatchLines, % old
}
+
+;; Git mode -------------------------------------------------------------------
+
+;; -> library
+
+q(s)
+{
+ return """" s """"
+}
+
+;; -> body
+
+#IfWinActive ahk_group Explorer
+
+#g::
+ToolTip, ...
+SendInput, {Blind}{LWin Up}
+Input, k, C L1
+
+ex := Explorer()
+i := ex.Document.FocusedItem.path
+path := ex.Document.Folder.Self.path
+slash := InStr(path, "\", 0, 0)
+basename := SubStr(path, slash + 1)
+
+if (k = "a")
+ Run, % "cmd /c cd "q(path)" & git add "q(i)" && git status & pause"
+if (k = "c")
+ Run, % "cmd /c cd "q(path)" & git commit & pause"
+if (k = "d")
+ Run, % "cmd /c cd "q(path)" & git diff "q(i)" & pause"
+if (k = "f")
+ Run, % "cmd /c cd "q(path)" & git diff & pause"
+if (k = "m")
+ Run, % "cmd /c cd "q(path)" & git commit --amend & pause"
+if (k = "p")
+ Run, % "cmd /c cd "q(path)" & git push origin "q(basename)" & pause"
+if (k = "r")
+ Run, % "cmd /c cd "q(path)" & git reset "q(i)" && git status & pause"
+if (k = "s")
+ Run, % "cmd /c cd "q(path)" & git status & pause"
+
+ToolTip
+return
+
+#IfWinActive