GithubHelp home page GithubHelp logo

jinweijie / vim-style-cursor-move Goto Github PK

View Code? Open in Web Editor NEW
29.0 2.0 3.0 15 KB

Replace arrow keys with Alt + hjkl binding using Autohotkey on Windows, Karabiner on Mac and Autokey on Linux.

AutoHotkey 86.23% Python 13.77%
autohotkey hjkl karabiner remapped-keys autokey vim

vim-style-cursor-move's Introduction

Vim Style Cursor Move

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)

Windows - Autohotkey

  1. Install Autohotkey.
  2. Clone this repository.
  3. 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.
  4. 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. :)

MacOS - Karabiner

  1. Install Karabiner.
  2. Clone this repository.
  3. Open https://genesy.github.io/karabiner-complex-rules-generator/
  4. Paste the content of ./mac-os/karabiner/karabiner.json to the right bottom textbox.
  5. Click Install! to install the configuration into your local Karabiner.

Linux - Autokey

  1. Install AutoKey.
  2. Clone this repository.
  3. Copy ./linux/autokey/hjkl folder to ~/.config/autokey/data/ folder.
  4. Open the AutoKey application to see the new keybindings.

Donate

If you would like to support my development, feel free to buy me a coffee, it makes a big difference! Thanks.

Buy Me A Coffee

vim-style-cursor-move's People

Contributors

jinweijie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.