From a556f1afa911d895cbdab93c83b252d3a9cb1ab1 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Thu, 7 May 2020 22:24:23 -0500 Subject: [PATCH 1/8] - Added commented out sublime text keymaps for VS Code under Windows --- windows/kinto.ahk | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/windows/kinto.ahk b/windows/kinto.ahk index 6680d2a..76af0f0 100644 --- a/windows/kinto.ahk +++ b/windows/kinto.ahk @@ -15,6 +15,11 @@ GroupAdd, ConEmu, ahk_exe ConEmu64.exe GroupAdd, ConEmu, ahk_exe WindowsTerminal.exe GroupAdd, editors, ahk_exe sublime_text.exe +GroupAdd, editors, ahk_exe VSCodium.exe +GroupAdd, editors, ahk_exe Code.exe + +GroupAdd, vscode, ahk_exe VSCodium.exe +GroupAdd, vscode, ahk_exe Code.exe ; Cmd+Space Alternative LWin & vk07::return @@ -56,7 +61,18 @@ $^+Right::Send +{End} !Right::Send ^{Right} !+Right::Send ^+{Right} -#IfWinActive ahk_group editors +; ; Sublime Text Remaps for VS Code +; #IfWinActive ahk_group vscode +; ; Remap Ctrl+Shift to behave like macOS Sublimetext +; ; Will extend cursor to multiple lines +; #+Up::send ^!{Up} +; #+Down::send ^!{Down} +; +; ; Remap Ctrl+Cmd+G to select all matches +; #^g::send ^+{L} +; #If + +#IfWinActive ahk_exe sublime_text.exe ; Remap Ctrl+Shift to behave like macOS Sublimetext ; Will extend cursor to multiple lines #+Up::send {shift up}^!{Up} From df5d2d8c0e880f4744c360af0c81251a292dd1f0 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 8 May 2020 02:47:00 -0500 Subject: [PATCH 2/8] - Added cmd.exe to kinto.ahk for Windows --- windows/kinto.ahk | 1 + 1 file changed, 1 insertion(+) diff --git a/windows/kinto.ahk b/windows/kinto.ahk index 76af0f0..a941a46 100644 --- a/windows/kinto.ahk +++ b/windows/kinto.ahk @@ -4,6 +4,7 @@ GroupAdd, terminals, ahk_exe ConEmu64.exe GroupAdd, terminals, ahk_exe powershell.exe GroupAdd, terminals, ahk_exe WindowsTerminal.exe GroupAdd, terminals, ahk_exe Hyper.exe +GroupAdd, terminals, ahk_exe Cmd.exe GroupAdd, posix, ahk_exe ubuntu.exe GroupAdd, posix, ahk_exe ConEmu.exe From 7904be6d5cc5c0de67a1c7b3244daae82f62b7b5 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 8 May 2020 03:26:11 -0500 Subject: [PATCH 3/8] - Added support for Fluent Terminal on Windows --- windows/kinto.ahk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/windows/kinto.ahk b/windows/kinto.ahk index a941a46..bdd9415 100644 --- a/windows/kinto.ahk +++ b/windows/kinto.ahk @@ -1,3 +1,5 @@ +SetTitleMatchMode, 2 + GroupAdd, terminals, ahk_exe ubuntu.exe GroupAdd, terminals, ahk_exe ConEmu.exe GroupAdd, terminals, ahk_exe ConEmu64.exe @@ -5,6 +7,7 @@ GroupAdd, terminals, ahk_exe powershell.exe GroupAdd, terminals, ahk_exe WindowsTerminal.exe GroupAdd, terminals, ahk_exe Hyper.exe GroupAdd, terminals, ahk_exe Cmd.exe +GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow GroupAdd, posix, ahk_exe ubuntu.exe GroupAdd, posix, ahk_exe ConEmu.exe From b85b786dcc449e7d479399323cd7f0cf962acb58 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 8 May 2020 03:46:34 -0500 Subject: [PATCH 4/8] - Firefox paste fix for Windows --- windows/kinto.ahk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/windows/kinto.ahk b/windows/kinto.ahk index bdd9415..331d198 100644 --- a/windows/kinto.ahk +++ b/windows/kinto.ahk @@ -86,6 +86,11 @@ $^+Right::Send +{End} #^g::send !{F3} #If +; Not sure why this fix is needed +#IfWinActive ahk_exe Firefox.exe + ^v::send ^v +#If + #IfWinActive ahk_group terminals ; Copy ^c::Send {LCtrl down}{LShift down}c{LCtrl Up}{LShift Up} From 9d5c7b6230d664f1de4af1417cce9765520d3101 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 8 May 2020 14:06:35 -0500 Subject: [PATCH 5/8] - Added Sublime hotkeys to VS Code to setup for windows --- setup.py | 7 ++++++- windows/autohotkey.ps1 | 3 +++ windows/kinto.ahk | 19 +++++++++---------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 39abe07..4f3941b 100755 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ def windows_setup(): os.system("regedit " + path + "\\windows\\standard_ctrlalt_capsesc_swap.reg") elif default == 5: os.system("regedit " + path + "\\windows\\remove_keyswap.reg") + stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC) if default > 0 and default < 5: print("Will now install chocolatey and autohotkey with elevated privileges...") print("This install will fail if you are not running with elevated privileges") @@ -32,7 +33,11 @@ def windows_setup(): print("\nWill now install Ubuntu Terminal Theme as default...") os.system("regedit " + path + "\\windows\\theme_ubuntu.reg") print("Copying autohotkey combinations for Terminals & Editors...") - os.system("copy /Y " + path + "\\windows\\kinto.ahk \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"") + os.system("copy /Y " + path + "\\windows\\kinto.ahk " + path + "\\windows\\kinto-new.ahk") + if(stvscode): + os.system('perl -pi -e "s/(; )(.*)(; ST2CODE)/$2$3/g" ./windows/kinto-new.ahk') + os.system("copy /Y " + path + "\\windows\\kinto-new.ahk \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"") + os.system("del /f .\\windows\\kinto-new.ahk") print("\nPlease log off and back on for changes to take full effect.") print("If using WSL then please remember to right click on title bar -> Properties -> Edit Options -> Use Ctrl+Shift+C/V as Copy/Paste and enable it.") else: diff --git a/windows/autohotkey.ps1 b/windows/autohotkey.ps1 index 5dd7305..af83f93 100644 --- a/windows/autohotkey.ps1 +++ b/windows/autohotkey.ps1 @@ -10,3 +10,6 @@ else{ if(-not(test-path "C:\Program Files\AutoHotkey\AutoHotkey.exe")){ choco install autohotkey.install } +if(-not(test-path "C:\Strawberry\")){ + choco install strawberryperl +} diff --git a/windows/kinto.ahk b/windows/kinto.ahk index 331d198..54a403e 100644 --- a/windows/kinto.ahk +++ b/windows/kinto.ahk @@ -65,16 +65,15 @@ $^+Right::Send +{End} !Right::Send ^{Right} !+Right::Send ^+{Right} -; ; Sublime Text Remaps for VS Code -; #IfWinActive ahk_group vscode -; ; Remap Ctrl+Shift to behave like macOS Sublimetext -; ; Will extend cursor to multiple lines -; #+Up::send ^!{Up} -; #+Down::send ^!{Down} -; -; ; Remap Ctrl+Cmd+G to select all matches -; #^g::send ^+{L} -; #If +; ; Sublime Text Remaps for VS Code ; ST2CODE +; #IfWinActive ahk_group vscode ; ST2CODE +; ; Remap Ctrl+Shift to behave like macOS Sublimetext ; ST2CODE +; ; Will extend cursor to multiple lines ; ST2CODE +; #+Up::send ^!{Up} ; ST2CODE +; #+Down::send ^!{Down} ; ST2CODE +; ; Remap Ctrl+Cmd+G to select all matches ; ST2CODE +; #^g::send ^+{L} ; ST2CODE +; #If ; ST2CODE #IfWinActive ahk_exe sublime_text.exe ; Remap Ctrl+Shift to behave like macOS Sublimetext From ed771f4ae419208bec47fc96dc382cee09a81734 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 8 May 2020 14:12:35 -0500 Subject: [PATCH 6/8] - Added refresh of environment variables after possible package installs on Windows --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 4f3941b..020eb45 100755 --- a/setup.py +++ b/setup.py @@ -30,6 +30,7 @@ def windows_setup(): print("Will now install chocolatey and autohotkey with elevated privileges...") print("This install will fail if you are not running with elevated privileges") os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"') + os.system('refreshenv') print("\nWill now install Ubuntu Terminal Theme as default...") os.system("regedit " + path + "\\windows\\theme_ubuntu.reg") print("Copying autohotkey combinations for Terminals & Editors...") From 17a877c6937e850a7672c310e5c4ccfd4576b36b Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 8 May 2020 18:24:07 -0500 Subject: [PATCH 7/8] - Improved CtrlTab to work with more apps under Windows 10 --- windows/kinto.ahk | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/windows/kinto.ahk b/windows/kinto.ahk index 54a403e..65d2acd 100644 --- a/windows/kinto.ahk +++ b/windows/kinto.ahk @@ -36,9 +36,25 @@ RWin::return ; Cmd Tab For App Switching LCtrl & Tab::AltTab RCtrl & Tab::AltTab + ; Ctrl Tab for In-App Tab Switching -LWin & Tab::Send ^{Tab} -RWin & Tab::Send ^{Tab} +; https://autohotkey.com/board/topic/72433-controltab/ +#if GetKeyState("LWin") +*Tab:: +if(!GetKeyState("LControl")) + Send {LControl Down} +Send {Tab} +SetTimer, WaitForWinUp, 10 +ToolTip trigger +return + +WaitForWinUp: +if(!GetKeyState("LWin", "P")) +{ + Send {LControl Up} + SetTimer, WaitForWinUp, Off +} +return ; Close Apps ^q::Send !{F4} From ad196c4d6be774d438e7f455ff8ef61231a8e2a4 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Sun, 10 May 2020 02:27:01 -0500 Subject: [PATCH 8/8] - Added ST3 keymap match all for VS Code on chromebooks --- xkeysnail-config/kinto.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xkeysnail-config/kinto.py b/xkeysnail-config/kinto.py index 4788038..f7c4ac0 100644 --- a/xkeysnail-config/kinto.py +++ b/xkeysnail-config/kinto.py @@ -140,7 +140,8 @@ define_keymap(re.compile("code", re.IGNORECASE),{ K("C-g"): K("f3"), # find_next K("Shift-f3"): pass_through_key, # cancel find_prev K("C-Shift-g"): K("Shift-f3"), # find_prev - K("Super-C-g"): K("C-f2"), # Sublime - find_all_under + K("Super-C-g"): K("C-f2"), # Default - Sublime - find_all_under + # K("C-M-g"): K("C-f2"), # Chromebook - Sublime - find_all_under K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down # K(""): pass_through_key, # cancel