How to minimize use of arrow keys when typing code?

后端 未结 11 1215
灰色年华
灰色年华 2021-02-05 10:23

When typing code, I would normally close brackets, go back inside, go outside, type semicolon, etc:

I might start with (| is the caret):

System.out.print         


        
11条回答
  •  一整个雨季
    2021-02-05 10:49

    Try AutoHotKey and my script:

    *!I::SendInput, % (GetKeyState("Shift", "P") ? "+" : "") (GetKeyState("Ctrl", "P") ? "^" : "") "{Up}"
    *!K::SendInput, % (GetKeyState("Shift", "P") ? "+" : "") (GetKeyState("Ctrl", "P") ? "^" : "") "{Down}"
    *!J::SendInput, % (GetKeyState("Shift", "P") ? "+" : "") (GetKeyState("Ctrl", "P") ? "^" : "") "{Left}"
    *!L::SendInput, % (GetKeyState("Shift", "P") ? "+" : "") (GetKeyState("Ctrl", "P") ? "^" : "") "{Right}"
    *!U::SendInput, % (GetKeyState("Shift", "P") ? "+" : "") (GetKeyState("Ctrl", "P") ? "^" : "") "{Home}"
    *!O::SendInput, % (GetKeyState("Shift", "P") ? "+" : "") (GetKeyState("Ctrl", "P") ? "^" : "") "{End}"
    *!h::SendInput, % (GetKeyState("Shift", "P") ? "+" : "") (GetKeyState("Ctrl", "P") ? "^" : "") "{Del}"
    

    LAlt & Shift:: ('optional line')

    It's about holding LAlt + pressing something from: i, k,j, l (arrow keys), u, o (home, end) or h (delete). Last line is optional if you don't want to change keyboard lang. layout by LAlt +Shift

    You can use it even in combination with modificators like shift and ctrl.

    enjoy ;)

提交回复
热议问题