29 lines
2.1 KiB
Plaintext
29 lines
2.1 KiB
Plaintext
<p><a href="https://github.com/hlissner/doom-emacs">Doom Emacs</a> comes with the <a href="https://github.com/hlissner/doom-emacs/blob/develop/modules/app/everywhere/README.org">emacs-everywhere</a> support.</p>
|
|
|
|
<p>With it, you can edit text anywhere with Emacs.</p>
|
|
|
|
<p>For example, if you are solving <a href="https://leetcode.com/">Leetcode</a> questions and want to edit the code with the Almighty Emacs:</p>
|
|
|
|
<p><img alt="emacs-everywhere-demo" src="https://user-images.githubusercontent.com/2715151/135779609-36cae0dd-30d3-49e5-965f-e039c86798e8.gif" /></p>
|
|
|
|
<p>To enable it, you uncomment the <code class="language-plaintext highlighter-rouge">everywhere</code> app in your Doom <code class="language-plaintext highlighter-rouge">init.el</code>.</p>
|
|
|
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>:app
|
|
|
|
everywhere ; *leave* Emacs!? You must be joking
|
|
</code></pre></div></div>
|
|
|
|
<p>In Mac OS X, to invoke the emacs everywhere, I need to set it up as a service. The way to do that is to use <code class="language-plaintext highlighter-rouge">Automator</code>, and create a <code class="language-plaintext highlighter-rouge">Quick Action</code>:</p>
|
|
|
|
<p><img alt="image" src="https://user-images.githubusercontent.com/2715151/135779709-87cb2c6a-cb05-4ebf-a0a4-41bde7e1a558.png" width="992" /></p>
|
|
|
|
<p>The bash script:</p>
|
|
|
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/path/to/emacsclient <span class="nt">--eval</span> <span class="s2">"(emacs-everywhere)"</span>
|
|
</code></pre></div></div>
|
|
|
|
<p>Then I assign the hotkey <code class="language-plaintext highlighter-rouge">⌘ + F9</code> to the service in Keyboard settings:</p>
|
|
|
|
<p><img alt="image" src="https://user-images.githubusercontent.com/2715151/135779857-1832309e-d3d2-41d4-a82c-d59d5c1d8835.png" width="661" /></p>
|
|
|
|
<p>Now whenever I press <code class="language-plaintext highlighter-rouge">Command</code> + <code class="language-plaintext highlighter-rouge">F9</code> key in any text area of the browser, a small Emacs window shows up and rescue all my text editing endeavors.</p> |