-
-
Notifications
You must be signed in to change notification settings - Fork 107
/
Copy pathvim_normal.ahk
58 lines (50 loc) · 1.45 KB
/
vim_normal.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
#If Vim.IsVimGroup() and (Vim.State.IsCurrentVimMode("Vim_Normal"))
; Undo/Redo
u::Send,^z
^r::Send,^y
; Combine lines
+j:: Send, {End}{Space}{Delete}
; Change case
~::
bak := ClipboardAll
Clipboard =
Send, +{Right}^x
ClipWait, 1
if(Clipboard is lower){
StringUpper, Clipboard, Clipboard
}else if(Clipboard is upper){
StringLower, Clipboard, Clipboard
}
Send, ^v
Clipboard := bak
Return
+z::Vim.State.SetMode("Z")
#If Vim.IsVimGroup() and (Vim.State.IsCurrentVimMode("Z"))
+z::
Send, ^s
Send, !{F4}
Vim.State.SetMode("Vim_Normal")
Return
+q::
Send, !{F4}
Vim.State.SetMode("Vim_Normal")
Return
#If Vim.IsVimGroup() and (Vim.State.IsCurrentVimMode("Vim_Normal"))
Space::Send, {Right}
; period
.::Send, +^{Right}{BS}^v
; Q-dir
#If Vim.IsVimGroup() and WinActive("ahk_group VimQdir") and (Vim.State.Mode == "Vim_Normal")
; For Q-dir, ^X mapping does not work, use !X instead.
; ^X does not work to be sent, too, use Down/Up
; switch to left top (1), right top (2), left bottom (3), right bottom (4)
!u::Send, {LControl Down}{1 Down}{1 Up}{LControl Up}
!i::Send, {LControl Down}{2 Down}{2 Up}{LControl Up}
!j::Send, {LControl Down}{3 Down}{3 Up}{LControl Up}
!k::Send, {LControl Down}{4 Down}{4 Up}{LControl Up}
; Ctrl+q, menu Quick-links
'::Send, {LControl Down}{q Down}{q Up}{LControl Up}
; Keep the e key in Normal mode, use the right button and then press the refresh (e) function, do nothing, return to the e key directly
~e::
Return
#If