Skip to content

Instantly share code, notes, and snippets.

@haruhi-s
Last active March 28, 2022 09:46
Show Gist options
  • Save haruhi-s/532b61936c0cf7bd7458e7ecb42f9ed3 to your computer and use it in GitHub Desktop.
Save haruhi-s/532b61936c0cf7bd7458e7ecb42f9ed3 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
}
cspace := 0
!t:: send, #2
#If (!WinActive("ahk_exe emacs.exe"))
!e::
if (WinActive("ahk_class VirtualConsoleClass"))
send, !{`}
send, #1
return
#If (!WinActive("ahk_exe CDViewer.exe") 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)
!<:: 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
!w:: Send, ^c
^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
^!l:: Send, ^#{Left}
^!sc027:: Send, ^#{Right}
!left:: Send, ^#{Left}
!right:: Send, ^#{Right}
#If (!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
^Space:: cspace := 1
^p:: Send, {Up}
$^n:: Send, {Down}
$#n:: Send, ^n
#SingleInstance Force
getSelection(){
ClipSaved := ClipboardAll
Clipboard := ""
Send, ^c
S := Clipboard
Clipboard := ClipSaved
ClipSaved := ""
return s
}
cspace := 0
!t:: send, #2
!l::WinActivate, Ubuntu
#If (!WinActive("ahk_exe emacs.exe"))
!e::WinActivate, emacs
#If (!WinActive("ahk_exe cmd.exe")) and (!WinActive("ahk_exe emacs.exe")) and (!WinActive("ahk_class VirtualConsoleClass")) and (!WinActive("MINGW") and (!WinActive("ahk_exe CDViewer.exe")) 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
!w:: Send, ^c
^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
^!l:: Send, ^#{Left}
^!sc027:: Send, ^#{Right}
!left:: Send, ^#{Left}
!right:: Send, ^#{Right}
#If (!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
^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