diff options
-rw-r--r-- | tt.programs.explorer.ahk | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/tt.programs.explorer.ahk b/tt.programs.explorer.ahk index 452888b..0e57d65 100644 --- a/tt.programs.explorer.ahk +++ b/tt.programs.explorer.ahk @@ -196,7 +196,7 @@ ExplorerFolderView(view, children := false) SetBatchLines, % old } -;; Git mode ------------------------------------------------------------------- +;; Git hotkeys ---------------------------------------------------------------- ;; -> library @@ -205,39 +205,36 @@ q(s) return """" s """" } +qp() +{ + return q(Explorer().Document.Folder.Self.path) +} + +qip() +{ + return q(Explorer().Document.FocusedItem.path) +} + +basename(s) +{ + slash := InStr(path, "\", 0, 0) + return SubStr(path, slash + 1) +} + ;; -> 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 +!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" +!d::Run, % "cmd /c cd "qp()" & git diff "qip()" & pause" +!+d::Run, % "cmd /c cd "qp()" & git diff & pause" +!f::Run, % "cmd /c cd "qp()" & git diff HEAD~1 HEAD "qip()" & pause" +!+f::Run, % "cmd /c cd "qp()" & git diff HEAD~1 HEAD & pause" +!l::Run, % "cmd /c cd "qp()" & git log & pause" +!p::Run, % "cmd /c cd "qp()" & git push origin "q(basename)" & pause" +!r::Run, % "cmd /c cd "qp()" & git reset "qip()" && git status & pause" +!s::Run, % "cmd /c cd "qp()" & git status & pause" #IfWinActive |