20 lines
1.5 KiB
Plaintext
20 lines
1.5 KiB
Plaintext
<p>Sometimes we find a file but don’t want to interrupt the work in progress in the current window. It is best to open it in a new window (or <em>frame</em>, in Emacs term).</p>
|
||
|
||
<p>If you are using <a href="https://oremacs.com/swiper">Ivy / Counsel / Swiper</a>, try the below workflow:</p>
|
||
|
||
<ol>
|
||
<li><code class="language-plaintext highlighter-rouge">M-x counsel-find-file</code>, or type <code class="language-plaintext highlighter-rouge">C-x C-f</code></li>
|
||
<li>Fill out the file name with the help of auto-completion (Tip: <a href="https://emacstil.com/til/2021/09/16/ivy-completion-with-current-selection/">Use <code class="language-plaintext highlighter-rouge">M-i</code> to complete the name without jumping to it</a>)</li>
|
||
<li>Press the <a href="https://oremacs.com/swiper/#hydra-in-the-minibuffer">Hydra key</a> <code class="language-plaintext highlighter-rouge">C-o</code> to open the Hydra menu</li>
|
||
<li>Press <code class="language-plaintext highlighter-rouge">f</code> to open in another frame. Voila!</li>
|
||
</ol>
|
||
|
||
<p>Bonus: There are other actions available in the Hydra menu, like copying the file path, mkdir, deleting file, etc.</p>
|
||
|
||
<p>Basically if we want to do any file related action, simply type <code class="language-plaintext highlighter-rouge">C-x C-f</code> and <em>wire up the action</em> as we need.</p>
|
||
|
||
<p>It’s neat!</p>
|
||
|
||
<p>Demo:</p>
|
||
|
||
<p><img alt="find-file-open-in-new-window" src="https://user-images.githubusercontent.com/2715151/136033348-815bc396-ec72-4a03-86fd-40a69018f45b.gif" /></p> |