Skip to content

Instantly share code, notes, and snippets.

@haruhi-s
Created January 18, 2023 12:11
Show Gist options
  • Save haruhi-s/546b2344e3cbbc5715c49d0ab9b7398c to your computer and use it in GitHub Desktop.
Save haruhi-s/546b2344e3cbbc5715c49d0ab9b7398c to your computer and use it in GitHub Desktop.
#SingleInstance Force
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}
getSelection(){
ClipSaved := ClipboardAll
Clipboard := ""
Send, ^c
S := Clipboard
Clipboard := ClipSaved
ClipSaved := ""
return s
}
!`::WinActivate, ahk_exe WindowsTerminal.exe
!l::WinActivate Ubuntu
!e::WinActivate emacs
!t::WinActivate [
#If (!WinActive("ahk_exe CDViewer.exe") and !WinActive("ahk_exe cmd.exe") and !WinActive("ahk_exe WindowsTerminal.exe") and (!WinActive("ahk_exe emacs.exe")) and (!WinActive("ahk_class VirtualConsoleClass")) and (!WinActive("MINGW") and (!WinActive("Rainbow Six")) and (!WinActive("ahk_exe Code.exe"))) and !isFullScreen)
!<:: Send, ^{Home}
!>:: Send, ^{End}
!f:: Send, ^{Right}
!b:: Send, ^{Left}
$^f:: Send, {Right}
^b:: Send, {Left}
$^a:: Send, {Home}
^e:: Send, {End}
^d:: Send, {Delete}
^h:: Send, {Backspace}
!Backspace:: Send, ^{Backspace}
!d:: Send, ^{Delete}
^k::
Clipboard :=
Send, +{Down}
if ( getSelection() ){
Send, +{Home}
Send, ^x
Return
}
Send, +{End}
Send, ^x
Return
^y:: Send, ^v
^/:: Send, ^z
^m:: Send, {Enter}
>^l:: Send, {Left}
>^SC027:: Send, {Right}
>^p:: Send, {Up}
>^.:: Send, {Down}
~LWin Up:: return
~RWin Up:: return
F3::
Send {SC126 down}
Send {F3}
Send {SC126 up}
Return
#f:: Send, ^f
#a:: Send, ^a
#b:: Send, ^b
#i:: Send, ^i
^!l:: Send, ^#{Left}
^!sc027:: Send, ^#{Right}
!left:: Send, ^#{Left}
!right:: Send, ^#{Right}
#If (!WinActive("ahk_exe CDViewer.exe")) and (!WinActive("ahk_class EVERYTHING")) and (!WinActive("ahk_exe cmd.exe")) and (!WinActive("ahk_exe emacs.exe")) and (!WinActive("ahk_class VirtualConsoleClass")) and (!WinActive("MINGW") and (!WinActive("Rainbow Six")) and (!WinActive("ahk_exe Code.exe"))) and !isFullScreen
!w:: Send, ^c
^p:: Send, {Up}
$^n:: Send, {Down}
$#n:: Send, ^n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment