Skip to content

Instantly share code, notes, and snippets.

@mihkels
Created April 11, 2017 12:02
Show Gist options
  • Save mihkels/0bf5086f32cff785e1a79384ef3cf48a to your computer and use it in GitHub Desktop.
Save mihkels/0bf5086f32cff785e1a79384ef3cf48a to your computer and use it in GitHub Desktop.
Get vim mode with Hammerspool
local function keyCode(key)
return function() hs.eventtap.keyStroke({}, key) end
end
hs.hotkey.bind({"cmd", "alt"}, 'h', keyCode('left') , nil, keyCode('left'))
hs.hotkey.bind({"cmd", "alt"}, 'j', keyCode('down') , nil, keyCode('down') )
hs.hotkey.bind({"cmd", "alt"}, 'k', keyCode('up') , nil, keyCode('up') )
hs.hotkey.bind({"cmd", "alt"}, 'l', keyCode('right'), nil, keyCode('right') )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment