DEV Community

Augusts Bautra
Augusts Bautra

Posted on

Set up keyboard shortcuts that type out stuff on Mac

2023 - It's actually possible to have arbitrary keyboard shortcuts that type out stuff like binding.pry on vanilla Mac. The setup is tricky, but no more than 10 mins.

  1. Set up a Quick Action via Automator.
  2. Tie the action to a shortcut (also in that SO thread)
  3. Allow VSC (or chrome, terminal, whatever) to send keystrokes by adding it to a11y as per the last line of this SO answer. This needs to only be done once, for the first such keystroke sender.

Top comments (2)

Collapse
 
dhruvindev profile image
Dhruvin

Use karabiner elements for more robust shortcuts

Collapse
 
epigene profile image
Augusts Bautra

I use Karabiner-Elements, but do not know how to set up typing shortcuts up with it. Is there a writeup?