forked from jaredlt/ahk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoHotkey.ahk
108 lines (81 loc) · 2.66 KB
/
AutoHotkey.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
; ==== PureText - Paste's plain text when using Win+V ====
; Hotkeys: Win+V
#v:: ; Text-only paste from ClipBoard
Clip0 = %ClipBoardAll%
ClipBoard = %ClipBoard% ; Convert to text
Send ^v ; For best compatibility: SendPlay
Sleep 50 ; Don't change clipboard while it is pasted! (Sleep > 0)
ClipBoard = %Clip0% ; Restore original ClipBoard
VarSetCapacity(Clip0, 0) ; Free memory
Return
; ==== Launches a new Notepad window (or activates an existing one) ====
; Hotkeys: Ctrl+Alt+N
^!n::
IfWinExist Untitled - Notepad
WinActivate
else
Run Notepad
return
; ==== Launches 1Password (or activates it) ====
; Hotkeys: Alt+p
!p::
If (WinExist 1Password)
{
WinActivate ; Activates 1Password
Sleep 50 ; Wait 50 milliseconds so CTRL+F doesn't active in the other window
Send ^f ; CTRL+F so search is focused
}
else
{
Run 1Password
}
return
; ==== Hotstrings ====
#Hotstring EndChars `t ;trigger key is tab only (prevents eg. space etc from triggering the hotstrings)
; --- ac > Acceptance Criteria ---
; Hotkeys: ac+Tab
:oc:ac::Acceptance Criteria
; --- us > User Story Markdown Template (multi-line and setting cursor position) ---
; Hotkeys: us+Tab
:oc:us::{#}{#}User Story`r`r- As a `r- I want `r- So that `r`r{#}{#}Requirements`r`r{Left 39}
:oc:story::
(
##Story:
(Situation; Motivations; Expected Outcomes)
- When
- I want
- So that
##Requirements
##Dependencies
##Wireframes
##Feature file
##Implementation strategy
##Branch
)
; --- bug > Bug Story Markdown Template ---
; Hotkeys: bug+Tab
:oc:bug::{#}{#}Steps to reproduce`r`r`r{#}{#}What you expected to see`r`r`r{#}{#}What you saw instead`r{Left 54}
; --- refactor > Refactor story template ---
; Hotkeys: refactor+Tab
:oc:refactor::{#}{#}Current state`r`r`r{#}{#}Problem`r`r`r{#}{#}Solution`r`r`r{#}{#}Refactor goal`r{Left 43}
; --- spike > Spike template ---
; Hotkeys: spike+Tab
:oc:spike::{#}{#}Main questions`r`r- `r`r{#}{#}Card goals`r{Left 15}
; --- scenario > Scenarios template ---
; Hotkeys: scenario+Tab
:oc:scenario::Scenario: `r`tGiven`rWhen`rThen`r{Left 21}
; --- auto close brackets and quotes ---
; ( => () AND [ => [] AND " => ""
;
; NB. the asterisk between the first two colons means
; "ending character not required" (so you don't have to
; press eg. 'tab' to get it to work - see: https://www.autohotkey.com/docs/Hotstrings.htm)
;
; if it gets annoying in some scenarios maybe take a look
; at http://www.autohotkey.com/board/topic/44574-intelligent-auto-close-bracketbraceparen/
;
;TO-DO: Enclose selected text instead of replacing it
:*:(::(){Left 1}
:*:[::[]{Left 1}
:*:"::""{Left 1}
:*:'::''{Left 1}