Configure the cursor movement style like vim for all major OS platforms by using Autohotkey for Windows, Karabiner for MacOS, and Autokey for Linux . This is extremely useful for moving the cursor around in a text editor, or browser for some selection when you just want a lightweight cursor movement experience.
The keybinding details are as following:
ALT + h -> LEFT (Cursor left one character)
ALT + j -> LEFT (Cursor down line)
ALT + k -> UP (Cursor up line)
ALT + l -> RIGHT (Cursor right one character)
ALT + b -> CTRL + LEFT (Cursor left per word)
ALT + w -> CTRL + RIGHT (Cursor right per word)
ALT + a -> HOME (Cursor to beginning of line)
ALT + f -> END (Cursor to end of line)
ALT + SHIFT + h -> SHIFT + LEFT (Select one character)
ALT + SHIFT + j -> SHIFT + LEFT (Select one line)
ALT + SHIFT + k -> SHIFT + UP (Select one line)
ALT + SHIFT + l -> SHIFT + RIGHT (Select one character)
ALT + SHIFT + b -> SHIFT + CTRL + LEFT (Select per word)
ALT + SHIFT + w -> SHIFT + CTRL + RIGHT (Select per word)
ALT + SHIFT + a -> SHIFT + HOME (Select to beginning of line)
ALT + SHIFT + f -> SHIFT + END (Select to end of line)
ALT + m -> DEL (Delete one character)
ALT + n -> BACKSPACE (Backspace one character)
ALT + u -> CTRL + z (Undo)
ALT + SHIFT + u -> CTRL + y (Redo)
- Install Autohotkey.
- Clone this repository.
- Execute AHK script.
- If you are using AHK 1.x, execute
./windows/vim-style-key-binding-1x.ahk
. - If you are using AHK 2.x, execute
./windows/vim-style-key-binding-2x.ahk
.
- If you are using AHK 1.x, execute
- If you would like to execute the script on startup on Windows, add the shortcut of the script to startup folder.
If you don't want the binding anymore, just don't run the script or remove it from startup folder. :)
- Install Karabiner.
- Clone this repository.
- Open https://genesy.github.io/karabiner-complex-rules-generator/
- Paste the content of
./mac-os/karabiner/karabiner.json
to the right bottom textbox. - Click
Install!
to install the configuration into your local Karabiner.
- Install AutoKey.
- Clone this repository.
- Copy
./linux/autokey/hjkl
folder to~/.config/autokey/data/
folder. - Open the AutoKey application to see the new keybindings.
If you would like to support my development, feel free to buy me a coffee, it makes a big difference! Thanks.