Skip to content

Instantly share code, notes, and snippets.

@thekoc
Created January 4, 2017 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thekoc/10f64dfb18f3c466ae79befab9432ec3 to your computer and use it in GitHub Desktop.
Save thekoc/10f64dfb18f3c466ae79befab9432ec3 to your computer and use it in GitHub Desktop.
emacs_env = hs.hotkey.modal.new('', nil)
emacs_env:bind('alt', 'F', function() hs.eventtap.keyStroke({"alt"}, "right") end)
emacs_env:bind('alt', 'B', function() hs.eventtap.keyStroke({"alt"}, "left") end)
emacs_env:bind('alt', 'D', function() hs.eventtap.keyStroke({"alt"}, "forwarddelete") end)
emacs_env:bind('ctrl', 'N', function() hs.eventtap.keyStroke({}, 'down') end)
emacs_env:bind('ctrl', 'P', function() hs.eventtap.keyStroke({}, 'up') end)
emacs_env:bind('ctrl', 'U', function () hs.eventtap.keyStroke({'cmd'}, 'delete') end)
emacs_env:bind('ctrl', 'W', function () hs.eventtap.keyStroke({'alt'}, 'delete') end)
emacs_env:enter()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment