It’s every Emacs user’s dream: to use Emacs for writing any text anywhere, especially in places where you normally couldn’t, like text fields in your browser, the Discord chat box, or the Discourse editor—just about anywhere you can think of. Now, it is possible. Here are your options:
Works on Linux and macOS.
This is an Emacs package which adds the autoloaded
emacs-everywhere function, which can be called via
emacsclient to spawn an Emacs frame to edit text in.
(This is included in Doom’s
:app everywhere module)
Simply enable Doom’s
:app everywhere module and bind a system keyboard shortcut to the following shell command:
emacsclient --eval "(emacs-everywhere)"
A daemon isn’t strictly needed (as Doom will start a server when starting Emacs), but you are free to set it up.
When pandoc is installed,
org-modewill be used by default. If you want to use
org-modeto edit markdown without installing pandoc, you can set the initial major-mode with:
(setq emacs-everywhere-major-mode-function #'org-mode)
Some users may try to set up rules for the emacs-everywhere window using their window manager (e.g. bspwm), but are unable to target it because of the complex title of the frame. You can change this with:
(setq emacs-everywhere-frame-name-format "emacs-everywhere")
Works on any platform.
Install the alpha22jp/atomic-chrome package with the following in your config:
;;; add to $DOOMDIR/packages.el (package! atomic-chrome) ;;; add to $DOOMDIR/config.el (atomic-chrome-start-server)
If you want to be especially mindful of startup time, you can defer starting the server until the first time you un-focus Emacs (presumably to focus your browser):
-(atomic-chrome-start-server) +(add-transient-hook! 'focus-out-hook (atomic-chrome-start-server))
$ doom syncand restart Emacs.
Install one of the supported browser extensions:
And you’re done! Click an the extension’s icon in your browser toolbar to edit the focused text area in Emacs.