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