DEV Community

Jeremy Friesen
Jeremy Friesen

Posted on • Originally published at takeonrules.com on

Send Anything in OS X to Emacs for Editing

Hacking Away with Hammerspoon and editWithEmacs

The worst part about Emacs is that sometimes you have to edit things outside of Emacs.

Yesterday, I found dmgerman/editWithEmacs.spoon. It uses Hammerspoon to send the current text to and from Emacs.

Explaining editWithEmacs.spoon

When I’m in a non-Emacs application (let’s say Firefox) and editing a text area (e.g., a Github Pull Request comment). I can type Ctrl+Alt+Cmd+e to transfer the text area’s content to a new Emacs buffer

In that buffer, I type away. When I’m done, I type Ctrl+c then Ctrl+c (e.g., C-c C-c in Emacs lingo) to send the content of that buffer back to the originating application.

Forking and Extending

, I forked the repository and began making updates. My fork now works wonderfully for my Emacs configuration; and exposes some additional configuration points that I think make this just a bit more extensible.

This is a big deal for me, because I’m now well accustomed to using Emacs for most longer form writing. And with my editWithEmacs.spoon, I can quickly jump into Emacs for writing.

Along the way, I also installed Miro Windows Manager for Hammerspoon. I cannot emphasize how awesome that script is for windows management.

Take a look at my Hammerspoon init.lua file. The two “spoons” that I’m using are already making my computing life just a bit nicer.,forem

Top comments (0)