Last active
July 11, 2019 06:43
-
-
Save transtone/5fd96d8cda084586107c740afd0c3d7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; #CommentFlag ; | |
; Key Syntax | |
; Alt ! | |
; Ctrl ^ | |
; Shift + | |
; Win Logo # | |
#NoTrayIcon | |
; windows console 和 mintty 中使用 tmux | |
#If WinActive("ahk_class mintty") || WinActive("ahk_class ConsoleWindowClass") | |
; n,p,k,t for tmux | |
!n:: | |
send {Ctrl Down}l{Ctrl up}n | |
return | |
!p:: | |
send {Ctrl Down}l{Ctrl up}p | |
return | |
!t:: | |
send {Ctrl Down}l{Ctrl up}c | |
return | |
#If | |
; windows console (CMD/PoserShell) 快捷键 | |
; 注意,在紧贴If的注释中不得出现“键”字,否则会使 If 失效 | |
; ======================== | |
#If WinActive("ahk_class ConsoleWindowClass") | |
RButton:: | |
send {ESC} | |
return | |
^y:: | |
send {Ctrl Down}{Shift Down}v{Ctrl Up}{Shift Up} | |
return | |
^v:: | |
send {Ctrl Down}{Shift Down}v{Ctrl Up}{Shift Up} | |
return | |
^m:: | |
Click Right | |
return | |
!w:: | |
send {Enter} | |
return | |
#If | |
setChineseLayout(){ | |
send {Ctrl Down}{Shift Down}1{Ctrl up}{Shift up} | |
} | |
setEnglishLayout(){ | |
send {Ctrl Down}{Shift Down}1{Ctrl up}{Shift up} | |
send {Ctrl Down}{Shift}{Ctrl Up} | |
} | |
; vi 插件中,用 ESC 切回普通模式时自动切换英文输入法。如不生效快速按 ESC n次,直到生效 | |
; ========= | |
#If WinActive("ahk_exe Code.exe") || WinActive("ahk_exe goland64.exe")|| WinActive("ahk_exe idea64.exe") || WinActive("ahk_exe webstorm64.exe") | |
ESC:: | |
{ | |
setEnglishLayout() | |
send {ESC} | |
return | |
} | |
#If | |
#IfWinActive, ahk_exe vcxsrv.exe | |
^Space:: | |
ControlSend, , ^{Space} | |
Return | |
^!:: | |
ControlSend, , ^! | |
Return | |
#If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment