- renamed file and added shortcuts

This commit is contained in:
Ben Reaves
2020-06-08 02:01:17 -05:00
parent c9f7b81796
commit 1ed7fa5f73
2 changed files with 266 additions and 252 deletions

View File

@@ -1,251 +1,259 @@
SetTitleMatchMode, 2 SetTitleMatchMode, 2
GroupAdd, terminals, ahk_exe ubuntu.exe GroupAdd, terminals, ahk_exe ubuntu.exe
GroupAdd, terminals, ahk_exe ConEmu.exe GroupAdd, terminals, ahk_exe ConEmu.exe
GroupAdd, terminals, ahk_exe ConEmu64.exe GroupAdd, terminals, ahk_exe ConEmu64.exe
GroupAdd, terminals, ahk_exe powershell.exe GroupAdd, terminals, ahk_exe powershell.exe
GroupAdd, terminals, ahk_exe WindowsTerminal.exe GroupAdd, terminals, ahk_exe WindowsTerminal.exe
GroupAdd, terminals, ahk_exe Hyper.exe GroupAdd, terminals, ahk_exe Hyper.exe
GroupAdd, terminals, ahk_exe Cmd.exe GroupAdd, terminals, ahk_exe Cmd.exe
GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow GroupAdd, terminals, ahk_exe Terminus.exe
GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow
GroupAdd, posix, ahk_exe ubuntu.exe
GroupAdd, posix, ahk_exe ConEmu.exe GroupAdd, posix, ahk_exe ubuntu.exe
GroupAdd, posix, ahk_exe ConEmu64.exe GroupAdd, posix, ahk_exe ConEmu.exe
GroupAdd, posix, ahk_exe Hyper.exe GroupAdd, posix, ahk_exe ConEmu64.exe
GroupAdd, posix, ahk_exe mintty.exe GroupAdd, posix, ahk_exe Hyper.exe
GroupAdd, posix, Fluent Terminal ahk_class ApplicationFrameWindow GroupAdd, posix, ahk_exe mintty.exe
GroupAdd, posix, ahk_exe Terminus.exe
GroupAdd, ConEmu, ahk_exe ConEmu.exe GroupAdd, posix, Fluent Terminal ahk_class ApplicationFrameWindow
GroupAdd, ConEmu, ahk_exe ConEmu64.exe
GroupAdd, ConEmu, ahk_exe WindowsTerminal.exe GroupAdd, ConEmu, ahk_exe ConEmu.exe
GroupAdd, ConEmu, ahk_exe ConEmu64.exe
GroupAdd, editors, ahk_exe sublime_text.exe GroupAdd, ConEmu, ahk_exe WindowsTerminal.exe
GroupAdd, editors, ahk_exe VSCodium.exe
GroupAdd, editors, ahk_exe Code.exe GroupAdd, editors, ahk_exe sublime_text.exe
GroupAdd, editors, ahk_exe VSCodium.exe
GroupAdd, vscode, ahk_exe VSCodium.exe GroupAdd, editors, ahk_exe Code.exe
GroupAdd, vscode, ahk_exe Code.exe
GroupAdd, vscode, ahk_exe VSCodium.exe
; New AltTab and CtrlTab fix GroupAdd, vscode, ahk_exe Code.exe
*tab::
{ ; New AltTab and CtrlTab fix
if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P") = false) { *tab::
Send {LCtrl down}{LAlt up}{tab} {
KeyWait, tab if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P") = false) {
} else if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P")) { Send {LCtrl down}{LAlt up}{tab}
Send {LCtrl down}{LAlt up}{LShift down}{tab} KeyWait, tab
KeyWait, tab } else if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P")) {
; } else if (GetKeyState("Primary", "P") AND GetKeyState("LShift", "P") = false) { Send {LCtrl down}{LAlt up}{LShift down}{tab}
} else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P") = false) { KeyWait, tab
Send {LAlt down}{tab} ; } else if (GetKeyState("Primary", "P") AND GetKeyState("LShift", "P") = false) {
KeyWait, tab } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P") = false) {
; } else if (GetKeyState("Primary", "P") AND GetKeyState("LShift", "P")) { Send {LAlt down}{tab}
} else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { KeyWait, tab
Send {LAlt down}{LShift down}{tab} ; } else if (GetKeyState("Primary", "P") AND GetKeyState("LShift", "P")) {
KeyWait, tab } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) {
; } else if (GetKeyState("Secondary", "P") AND GetKeyState("LShift", "P") = false) { Send {LAlt down}{LShift down}{tab}
} else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { KeyWait, tab
return ; } else if (GetKeyState("Secondary", "P") AND GetKeyState("LShift", "P") = false) {
; ; } else if (GetKeyState("Secondary", "P") AND GetKeyState("LShift", "P")) { } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) {
} else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { return
return ; ; } else if (GetKeyState("Secondary", "P") AND GetKeyState("LShift", "P")) {
} else { } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) {
send {Blind}{tab} return
} } else {
return send {Blind}{tab}
} }
return
tab::Send {tab} }
+tab::Send {Shift down}{tab}{Shift up} tab::Send {tab}
; Basic Remap +tab::Send {Shift down}{tab}{Shift up}
;
; Primary::LCtrl ; Basic Remap
; Secondary::LAlt ;
; Tertiary::LWin ; Primary::LCtrl
; Secondary::LAlt
$LCtrl::LWin ; Tertiary::LWin
$LWin::LCtrl
$LCtrl::LWin
; Hack to disable start menu on winkey $LWin::LCtrl
; $LCtrl up::Send {Ctrl down}{Primary up}{Ctrl up}
$LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up} ; Hack to disable start menu on winkey
; $LCtrl up::Send {Ctrl down}{Primary up}{Ctrl up}
; temporary hack to ensure keys don't get stuck $LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up}
; impacts Alt-Tab fix
; Primary up::Send {LAlt up}{LCtrl up} ; temporary hack to ensure keys don't get stuck
$LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; impacts Alt-Tab fix
; Primary up::Send {LAlt up}{LCtrl up}
; Close Apps $LWin up::Send {LWin up}{LAlt up}{LCtrl up}
^q::Send !{F4}
; Close Apps
; Emoji Panel ^q::Send !{F4}
#^Space::Send {LWin down};{LWin up}
; Emoji Panel
; Full Screenshot #^Space::Send {LWin down};{LWin up}
^+3::Send {PrintScreen}
; Full Screenshot
; Region Screenshot ^+3::Send {PrintScreen}
^+4::Send #+{S}
; Region Screenshot
; wordwise support ^+4::Send #+{S}
$^Left::Send {Home}
$^+Left::Send +{Home} ; wordwise support
$^Right::Send {End} $^Left::Send {Home}
$^+Right::Send +{End} $^+Left::Send +{Home}
^Up::Send ^{Home} $^Right::Send {End}
^+Up::Send ^+{Home} $^+Right::Send +{End}
^Down::Send ^{End} ^Up::Send ^{Home}
^+Down::Send ^+{End} ^+Up::Send ^+{Home}
^Backspace::Send +{Home}{Delete} ^Down::Send ^{End}
!Backspace::Send ^{Backspace} ^+Down::Send ^+{End}
!Left::Send ^{Left} ^Backspace::Send +{Home}{Delete}
!+Left::Send ^+{Left} !Backspace::Send ^{Backspace}
!Right::Send ^{Right} !Left::Send ^{Left}
!+Right::Send ^+{Right} !+Left::Send ^+{Left}
!Right::Send ^{Right}
; Cmd+Space Alternative !+Right::Send ^+{Right}
^Space::Send ^{Esc}
; Cmd+Space Alternative
; ; Sublime Text Remaps for VS Code ^Space::Send ^{Esc}
#IfWinActive ahk_group vscode ; ST2CODE
; Remap Ctrl+Shift to behave like macOS Sublimetext ; ; Sublime Text Remaps for VS Code
; Will extend cursor to multiple lines #IfWinActive ahk_group vscode ; ST2CODE
#+Up::send ^!{Up} ; ST2CODE ; Remap Ctrl+Shift to behave like macOS Sublimetext
#+Down::send ^!{Down} ; ST2CODE ; Will extend cursor to multiple lines
; Remap Ctrl+Cmd+G to select all matches #+Up::send ^!{Up} ; ST2CODE
#^g::send ^+{L} ; ST2CODE #+Down::send ^!{Down} ; ST2CODE
#If ; ST2CODE ; Remap Ctrl+Cmd+G to select all matches
#^g::send ^+{L} ; ST2CODE
#IfWinActive ahk_exe sublime_text.exe #If ; ST2CODE
; Remap Ctrl+Shift to behave like macOS Sublimetext
; Will extend cursor to multiple lines #IfWinActive ahk_exe sublime_text.exe
#+Up::send {shift up}^!{Up} ; Remap Ctrl+Shift to behave like macOS Sublimetext
#+Down::send {shift up}^!{Down} ; Will extend cursor to multiple lines
#+Up::send {shift up}^!{Up}
; Remap Ctrl+Cmd+G to select all matches #+Down::send {shift up}^!{Down}
#^g::send !{F3}
#If ; Remap Ctrl+Cmd+G to select all matches
#^g::send !{F3}
#IfWinActive ahk_group terminals #If
; Copy
^c:: #IfWinActive ahk_group terminals
SetKeyDelay -1 ; Copy
Send {Blind}{LShift down}{c DownTemp} ^c::
return SetKeyDelay -1
Send {Blind}{LShift down}{c DownTemp}
^c up:: return
SetKeyDelay -1
Send {Blind}{c Up}{LShift Up} ^c up::
return SetKeyDelay -1
Send {Blind}{c Up}{LShift Up}
; Paste return
^v::
If not WinActive("ahk_group ConEmu") && not WinActive("ahk_exe cmd.exe"){ ; Sigints - interrupt
SetKeyDelay -1 $#c::Send {Ctrl down}c{Ctrl up}
Send {Blind}{LShift down}{v DownTemp}
} ; Paste
else{ ^v::
Send {Blind}v If not WinActive("ahk_group ConEmu") && not WinActive("ahk_exe cmd.exe"){
} SetKeyDelay -1
return Send {Blind}{LShift down}{v DownTemp}
}
^v up:: else{
SetKeyDelay -1 Send {Blind}v
Send {Blind}{v Up}{LShift Up} }
return return
#If
^v up::
#IfWinActive ahk_group posix SetKeyDelay -1
; Open/Close Tab for those that support it Send {Blind}{v Up}{LShift Up}
$^t:: return
If not WinActive("ahk_group ConEmu"){ #If
Send {LCtrl down}{LShift down}t{LCtrl Up}{LShift Up}
} #IfWinActive ahk_group posix
else{ ; Open/Close Tab for those that support it
Send ^t $^t::
} If not WinActive("ahk_group ConEmu"){
return Send {LCtrl down}{LShift down}t{LCtrl Up}{LShift Up}
}
$^w:: else{
If not WinActive("ahk_group ConEmu"){ Send ^t
Send {LCtrl down}{LShift down}w{LCtrl Up}{LShift Up} }
} return
else{
Send ^w $^w::
} If not WinActive("ahk_group ConEmu"){
return Send {LCtrl down}{LShift down}w{LCtrl Up}{LShift Up}
}
; End of Line else{
^e:: Send ^w
SetKeyDelay -1 }
Send {Blind}{e DownTemp} return
return
; End of Line
^e up:: ^e::
SetKeyDelay -1 SetKeyDelay -1
Send {Blind}{e Up} Send {Blind}{e DownTemp}
return return
; Beginning of Line ^e up::
^a:: SetKeyDelay -1
SetKeyDelay -1 Send {Blind}{e Up}
Send {Blind}{a DownTemp} return
return
; Beginning of Line
^a up:: ^a::
SetKeyDelay -1 SetKeyDelay -1
Send {Blind}{a Up} Send {Blind}{a DownTemp}
return return
^l::Send clear{Enter} ^a up::
; #l::return SetKeyDelay -1
; Clear Terminal and Scroll Buffer Send {Blind}{a Up}
^k::Send clear && printf '\e[3J'{Enter} return
; Nano editor shortcuts
#k::Send {LCtrl down}k{LCtrl Up} ^l::Send clear{Enter}
#x::Send {LCtrl down}x{LCtrl Up} ; #l::return
#o::Send {LCtrl down}o{LCtrl Up} ; Clear Terminal and Scroll Buffer
#r::Send {LCtrl down}r{LCtrl Up} ^k::Send clear && printf '\e[3J'{Enter}
#w::Send {LCtrl down}w{LCtrl Up} ; Nano editor shortcuts
#\::Send {LCtrl down}\{LCtrl Up} #g::Send {LCtrl down}g{LCtrl Up}
#u::Send {LCtrl down}u{LCtrl Up} #k::Send {LCtrl down}k{LCtrl Up}
#j::Send {LCtrl down}j{LCtrl Up} #x::Send {LCtrl down}x{LCtrl Up}
#t::Send {LCtrl down}t{LCtrl Up} #o::Send {LCtrl down}o{LCtrl Up}
#_::Send {LCtrl down}_{LCtrl Up} #r::Send {LCtrl down}r{LCtrl Up}
#z::Send {LCtrl down}z{LCtrl Up} #w::Send {LCtrl down}w{LCtrl Up}
#If #\::Send {LCtrl down}\{LCtrl Up}
#u::Send {LCtrl down}u{LCtrl Up}
; #IfWinActive ahk_group ConEmu #j::Send {LCtrl down}j{LCtrl Up}
; ; Paste #t::Send {LCtrl down}t{LCtrl Up}
; $^v::Send {Shift down}{Insert}{Shift Up} #_::Send {LCtrl down}_{LCtrl Up}
; #v::Send {LCtrl down}v{LCtrl Up} #z::Send {LCtrl down}z{LCtrl Up}
; #If #y::Send {LCtrl down}y{LCtrl Up}
#v::Send {LCtrl down}v{LCtrl Up}
; #IfWinActive ahk_exe mintty.exe #If
; ; Copy
; $^c::Send {Control down}{Insert}{Control Up} ; #IfWinActive ahk_group ConEmu
; #c::Send {LCtrl down}c{LCtrl Up} ; ; Paste
; ; Paste ; $^v::Send {Shift down}{Insert}{Shift Up}
; $^v::Send {Shift down}{Insert}{Shift Up} ; #v::Send {LCtrl down}v{LCtrl Up}
; #v::Send {LCtrl down}v{LCtrl Up} ; #If
; #If
; #IfWinActive ahk_exe mintty.exe
;Disable win + l key locking (This line must come before any hotkey assignments in the .ahk file) ; ; Copy
; $^c::Send {Control down}{Insert}{Control Up}
; Admin privileges required ; #c::Send {LCtrl down}c{LCtrl Up}
; Sets Workstation Lock to not occur on Win+L ; ; Paste
; RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 1 ; $^v::Send {Shift down}{Insert}{Shift Up}
; #v::Send {LCtrl down}v{LCtrl Up}
; Re-enables Workstation lock on Ctrl+Cmd+Q ; #If
; Need to Remove Quick Assist and reboot
; Remove-WindowsCapability -online -name App.Support.QuickAssist~~~~0.0.1.0 ;Disable win + l key locking (This line must come before any hotkey assignments in the .ahk file)
; #^q::
; re-enable locking workstation, then lock it ; Admin privileges required
; RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 0 ; Sets Workstation Lock to not occur on Win+L
; DllCall("LockWorkStation") ; RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 1
; Reload script to relock Workstation Lock
; Reload ; Re-enables Workstation lock on Ctrl+Cmd+Q
; Need to Remove Quick Assist and reboot
; Remove-WindowsCapability -online -name App.Support.QuickAssist~~~~0.0.1.0
; #^q::
; re-enable locking workstation, then lock it
; RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 0
; DllCall("LockWorkStation")
; Reload script to relock Workstation Lock
; Reload
;return ;return

View File

@@ -151,12 +151,15 @@ $^+Right::Send +{End}
^c:: ^c::
SetKeyDelay -1 SetKeyDelay -1
Send {Ctrl down}{Shift down}{c DownTemp} Send {Ctrl down}{Shift down}{c DownTemp}
; return return
^c up:: ^c up::
SetKeyDelay -1 SetKeyDelay -1
Send {c Up}{Ctrl up}{Shift up} Send {c Up}{Ctrl up}{Shift up}
; return return
; Sigints - interrupt
$#c::Send {Ctrl down}c{Ctrl up}
; Paste ; Paste
*v:: *v::
@@ -224,6 +227,7 @@ $^+Right::Send +{End}
; Clear Terminal and Scroll Buffer ; Clear Terminal and Scroll Buffer
^k::Send clear && printf '\e[3J'{Enter} ^k::Send clear && printf '\e[3J'{Enter}
; Nano editor shortcuts ; Nano editor shortcuts
#g::Send {LCtrl down}g{LCtrl Up}
#k::Send {LCtrl down}k{LCtrl Up} #k::Send {LCtrl down}k{LCtrl Up}
#x::Send {LCtrl down}x{LCtrl Up} #x::Send {LCtrl down}x{LCtrl Up}
#o::Send {LCtrl down}o{LCtrl Up} #o::Send {LCtrl down}o{LCtrl Up}
@@ -235,6 +239,8 @@ $^+Right::Send +{End}
#t::Send {LCtrl down}t{LCtrl Up} #t::Send {LCtrl down}t{LCtrl Up}
#_::Send {LCtrl down}_{LCtrl Up} #_::Send {LCtrl down}_{LCtrl Up}
#z::Send {LCtrl down}z{LCtrl Up} #z::Send {LCtrl down}z{LCtrl Up}
#y::Send {LCtrl down}y{LCtrl Up}
#v::Send {LCtrl down}v{LCtrl Up}
#If #If
; #IfWinActive ahk_group ConEmu ; #IfWinActive ahk_group ConEmu