System-wide hybrid emacs/vim keybindings for macOS.
- Download hammerspoon: http://www.hammerspoon.org/.
- Clone the repo into your
~/.hammerspoon/directory. - Add the module in your
init.luahammerspoon config file.
-- init.lua
-- @see: ~/.hammerspoon/init.lua
-- Including the hybrid module
local hybrid = require("hs-hybrid")Enable and disable hybrid mode with cmd + esc when hammerspoon is running. When you press esc, you will enter vim normal-mode. By default you are in emacs-mode, which functions as vim insert-mode, with the addition of emacs keybindings.
The motivation behind this repo is that I get annoyed when I can't use vim or emacs keybindings in my daily computer use. This lua script for hammerspoon was made to provide system-wide, vim and emacs keybindings akin to those offered in spacemacs.
insert-mode for vim has all of the emacs keybindings by default. Pressing esc in this mode will let you enter the modal normal-mode for vim.