Wednesday, November 28, 2018

keyboard shortcuts - How can I jump 2 words at a time throughout Windows?


Ever since I learned about using Ctrl with the arrow keys, backspace key, and delete key, I've felt my typing and editing productivity go up significantly.


I'd like to know if there's an easy way to define a shortcut to jump 2 words at a time, delete 2 words at a time, etc. that can be used natively throughout Windows like Ctrl + can?


If not, is it possible to implement via something like an AutoHotKey script? (eg. Ctrl + Alt + to jump 2 words to the left or Ctrl + Alt + Backspace to delete 2 words at a time?)


Answer



AutoHotkey will do exactly that. Or you can tailor the shortcut keys to be context specific and only trigger when certain programs are active.


#Persistent
#IfWinActive ; Every window. Change this line to tailor specificity
^!Left::SendInput, ^{Left 2}
^!Right::SendInput, ^{Right 2}
^!Backspace::SendInput, {Backspace 2} ; delete two characters at a time
^!Backspace::SendInput, +^{Left}{Backspace} ; delete a word at a time
^!Backspace::SendInput, +^{Left 2}{Backspace} ; delete two words at a time

Pick only one of the three definitions for Ctrl + Alt + Backspace obviously.


Hotkey modifiers are in the AutoHotkey help file, but for quick reference, ^ is Control, ! is Alt, + is Shift and # is the Windows button.


If you need to make a multi-line macro with sleep statements or something, start on the next line after the hotkey definition and end the macro with a Return statement.


^!Left::
SendInput, ^{Left 2}
Sleep 200 ; Sleeping 10 to 200ms can help for
; reliability in multi-key-press functions,
; depending on what you're doing
Return

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...