Skip to content

Instantly share code, notes, and snippets.

@brettstack
Last active October 14, 2021 09:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brettstack/23ff727d16f9fe648e8ca0176e807105 to your computer and use it in GitHub Desktop.
Save brettstack/23ff727d16f9fe648e8ca0176e807105 to your computer and use it in GitHub Desktop.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; ALT + Left/Right to Start/End of line
!Left::Send, {Home}
!Right::Send, {End}
!+Left::Send, {ShiftDown}{Home}{ShiftUp}
!+Right::Send, {ShiftDown}{End}{ShiftUp}
; ALT + Up/Down to Start/End of file
!Up::Send, {LCtrl Down}{Home}{LCtrl Up}
!Down::Send, {LCtrl Down}{End}{LCtrl Up}
!+Up::Send, {ShiftDown}{LCtrl Down}{Home}{LCtrl Up}{ShiftUp}
!+Down::Send, {ShiftDown}{LCtrl Down}{End}{LCtrl Up}{ShiftUp}
; ALT + Up/Down to Start/End of file
#Left::Send, {LCtrl Down}{left}{LCtrl Up}
#Right::Send, {LCtrl Down}{right}{LCtrl Up}
#+Left::Send, {ShiftDown}{LCtrl Down}{left}{LCtrl Up}{ShiftUp}
#+Right::Send, {ShiftDown}{LCtrl Down}{right}{LCtrl Up}{ShiftUp}
; Change workspaces
LCtrl & left::Send, {LCtrl Down}{LWinDown}{left}{LWinUp}{LCtrl Up}
LCtrl & right::Send, {LCtrl Down}{LWinDown}{right}{LWinUp}{LCtrl Up}
LCtrl & down::Send, {LWinDown}{d}{LWinUp}
LCtrl & up::Send, {LWinDown}{Tab}{LWinUp}
; ALT + Backspace to delete line
!BS::Send {LShift down}{Home}{LShift Up}{Del}
#BS::Send {LCtrl Down}{BS}{LCtrl Up}
; Common CTRL shortcuts mapped to ALT shortuts
!c::send, {LCtrl Down}{c}{LCtrl Up}
!x::send, {LCtrl Down}{x}{LCtrl Up}
!v::send, {LCtrl Down}{v}{LCtrl Up}
; WSL paste
!+v::send, {LCtrl Down}{Lshift down}{v}{Lshift up}{LCtrl Up}
!z::send, {LCtrl Down}{z}{LCtrl Up}
!+z::send, {LCtrl Down}{Lshift down}{z}{Lshift up}{LCtrl Up}
!y::send, {LCtrl Down}{y}{LCtrl Up}
!s::send, {LCtrl Down}{s}{LCtrl Up}
!a::send, {LCtrl Down}{a}{LCtrl Up}
!d::send, {LCtrl Down}{d}{LCtrl Up}
!f::send, {LCtrl Down}{f}{LCtrl Up}
!+f::send, {LCtrl Down}{Lshift down}{f}{Lshift up}{LCtrl Up}
!t::send, {LCtrl Down}{t}{LCtrl Up}
!+t::send, {LCtrl Down}{Lshift down}{t}{Lshift up}{LCtrl Up}
!n::send, {LCtrl Down}{n}{LCtrl Up}
!+n::send, {LCtrl Down}{Lshift down}{n}{Lshift up}{LCtrl Up}
!r::send, {LCtrl Down}{r}{LCtrl Up}
!b::send, {LCtrl Down}{b}{LCtrl Up}
!/::send, {LCtrl Down}{/}{LCtrl Up}
!,::send, {LCtrl Down}{,}{LCtrl Up}
!Enter::send, {LCtrl Down}{Enter}{LCtrl Up}
!LButton::send, {LCtrl Down}{LButton}{LCtrl Up}
; VSCode shortcuts
!+p::Send, {LCtrl Down}{Lshift down}{p}{Lshift up}{LCtrl Up}
!p::Send, {LCtrl Down}{p}{LCtrl Up}
; Alt+Space to Windows+S for search/spotlight
!Space::send, {LWin down}{s}{LWin up}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment