<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>alavi.me - vim&#x2F;nvim</title>
    <subtitle>My mind on the web</subtitle>
    <link rel="self" type="application/atom+xml" href="https://alavi.me/tags/vim-nvim/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://alavi.me"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-01-21T00:00:00+00:00</updated>
    <id>https://alavi.me/tags/vim-nvim/atom.xml</id>
    <entry xml:lang="en">
        <title>Vim Is Much More Powerful Than You Think: Netrw</title>
        <published>2026-01-21T00:00:00+00:00</published>
        <updated>2026-01-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            Alireza Alavi
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://alavi.me/blog/power-of-netrw/"/>
        <id>https://alavi.me/blog/power-of-netrw/</id>
        
        
        <content type="html" xml:base="https://alavi.me/blog/power-of-netrw/">&lt;p&gt;I&#x27;ve been using Neovim for almost 3 years now, and I only used it&#x27;s built-in &lt;kbd&gt;Netrw&lt;&#x2F;kbd&gt; to navigate my project. I always thought Netrw is just a simple file explorer, allowing you to see directories and move between them. That&#x27;s all. No tree, no copy pasting or moving files, no opening files in other applications.&lt;br &#x2F;&gt;
Man, was I wrong.&lt;&#x2F;p&gt;
&lt;p&gt;Of course I knew about the &lt;kbd&gt;R&lt;&#x2F;kbd&gt; key which allows you to rename files&#x2F;dirs, &lt;kbd&gt;%&lt;&#x2F;kbd&gt; which allows you to create new file,&lt;kbd&gt;D&lt;&#x2F;kbd&gt; that removes the file&#x2F;dir and things like that. But no more to be honest. I would just do &lt;code&gt;!thunar .&amp;amp;&lt;&#x2F;code&gt; when things got a bit complicated.&lt;&#x2F;p&gt;
&lt;p&gt;It never amazes me that no matter how much I use and learn about Neovim or Vim, there&#x27;s still a lot that I don&#x27;t know.&lt;br &#x2F;&gt;
Today I accidentally pressed &lt;kbd&gt;i&lt;&#x2F;kbd&gt; in Netrw and saw that it has a tree view of your directories. The thing I was most missing from Netrw and it was right there!&lt;&#x2F;p&gt;
&lt;p&gt;You can learn everything about it just by pressing &lt;kbd&gt;&amp;lt;F1&amp;gt;&lt;&#x2F;kbd&gt; and going through the manual, but here&#x27;s a quick list.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;cool-shortcuts&quot;&gt;Cool shortcuts&lt;a class=&quot;zola-anchor&quot; href=&quot;#cool-shortcuts&quot; aria-label=&quot;Anchor link for: cool-shortcuts&quot;&gt;&lt;i class=&quot;icon&quot;&gt;&lt;&#x2F;i&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Listing&#x2F;View
&lt;ul&gt;
&lt;li&gt;&lt;kbd&gt;&amp;lt;c-l&amp;gt;&lt;&#x2F;kbd&gt;	Causes Netrw to refresh the directory listing        |netrw-ctrl-l|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;i&lt;&#x2F;kbd&gt;   Cycle between thin, long, wide, and tree listings    |netrw-i|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;gn&lt;&#x2F;kbd&gt;	Make top of tree the directory below the cursor      |netrw-gn|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;I&lt;&#x2F;kbd&gt;	Toggle the displaying of the banner                  |netrw-I|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;gh&lt;&#x2F;kbd&gt;	Quick hide&#x2F;unhide of dot-files                       |netrw-gh|&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Marking
&lt;ul&gt;
&lt;li&gt;&lt;kbd&gt;mf&lt;&#x2F;kbd&gt;	Mark a file                                          |netrw-mf|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;mt&lt;&#x2F;kbd&gt;	Current browsing directory becomes markfile target   |netrw-mt|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;mu&lt;&#x2F;kbd&gt;	Unmark all marked files                              |netrw-mu|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;mc&lt;&#x2F;kbd&gt;	Copy marked files to marked-file target directory    |netrw-mc|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;md&lt;&#x2F;kbd&gt;	Apply diff to marked files (up to 3)                 |netrw-md|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;mg&lt;&#x2F;kbd&gt;	Apply &lt;code&gt;vimgrep&lt;&#x2F;code&gt; to marked files                        |netrw-mg|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;mr&lt;&#x2F;kbd&gt;	Mark files using a shell-style |regexp|                |netrw-mr|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;mv&lt;&#x2F;kbd&gt;	Apply arbitrary vim   command to marked files        |netrw-mv|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;mx&lt;&#x2F;kbd&gt;	Apply arbitrary shell command to marked files        |netrw-mx|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;mz&lt;&#x2F;kbd&gt;	Compress&#x2F;decompress marked files                     |netrw-mz|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;p&lt;&#x2F;kbd&gt;	Preview the file                                     |netrw-p|&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;CRUD
&lt;ul&gt;
&lt;li&gt;&lt;kbd&gt;d&lt;&#x2F;kbd&gt;	Make a directory                                     |netrw-d|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;D&lt;&#x2F;kbd&gt;	Attempt to remove the file(s)&#x2F;directory(ies)         |netrw-D|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;R&lt;&#x2F;kbd&gt;	Rename the designated file(s)&#x2F;directory(ies)         |netrw-R|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;%&lt;&#x2F;kbd&gt;  Open a new file in netrw&#x27;s current directory         |netrw-%|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;x&lt;&#x2F;kbd&gt; View file with an associated program (e.g. open HTML file in your browser)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Navigation
&lt;ul&gt;
&lt;li&gt;&lt;kbd&gt;-&lt;&#x2F;kbd&gt;	Makes Netrw go up one directory                      |netrw--|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;cd&lt;&#x2F;kbd&gt;	Make browsing directory the current directory        |netrw-cd|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;t&lt;&#x2F;kbd&gt;	Enter the file&#x2F;directory under the cursor in a new tab  |netrw-t|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;v&lt;&#x2F;kbd&gt;	Enter the file&#x2F;directory under the cursor in a new browser window.  A vertical split is used.&lt;&#x2F;li&gt;
&lt;li&gt;Bookmarking
&lt;ul&gt;
&lt;li&gt;&lt;kbd&gt;mb&lt;&#x2F;kbd&gt;	Bookmark current directory                           |netrw-mb|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;mB&lt;&#x2F;kbd&gt;	Delete bookmark of current directory                           |netrw-mB|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;kbd&gt;qb&lt;&#x2F;kbd&gt;	List bookmarked directories and history              |netrw-qb|&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;{number}&lt;&#x2F;code&gt;&lt;kbd&gt;gb&lt;&#x2F;kbd&gt;	Go to previous bookmarked directory (or the bookmark number from &lt;kbd&gt;qb&lt;&#x2F;kbd&gt;)                  |netrw-gb|&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;remote-files&quot;&gt;Remote Files&lt;a class=&quot;zola-anchor&quot; href=&quot;#remote-files&quot; aria-label=&quot;Anchor link for: remote-files&quot;&gt;&lt;i class=&quot;icon&quot;&gt;&lt;&#x2F;i&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;This is honestly so awesome.&lt;br &#x2F;&gt;
You can just communicate with your remote files from SCP, FTP, SSH, Rsync, curl, dav etc.&lt;&#x2F;p&gt;
&lt;p&gt;I will mostly use this for working on my servers.&lt;br &#x2F;&gt;
If you use SSH keys to authenticate to your server, it will be as simple as&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;nvim rsync:&#x2F;&#x2F;[user]@[host]&#x2F;[filepath]&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;For example:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;nvim scp:&#x2F;&#x2F;[user]@[host]&#x2F;&#x2F;opt&#x2F;docker-compose-files&#x2F;&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;If you want to navigate a dir, add a &#x2F; at the end of the filepath.&lt;&#x2F;p&gt;
&lt;p&gt;If your SSH key has a password, in your terminal do:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#4C4F69, #CDD6F4); background-color: light-dark(#EFF1F5, #1E1E2E);&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;ssh-agent&lt;&#x2F;span&gt;&lt;span&gt; $&lt;&#x2F;span&gt;&lt;span&gt;SHELL&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;ssh-add&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; &#x2F;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; this&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; will&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; ask&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; you&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; once&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#1E66F5, #89B4FA);font-style: italic;&quot;&gt;nvim&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#40A02B, #A6E3A1);&quot;&gt; rsync:&#x2F;&#x2F;[host]&#x2F;[filepath]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you don&#x27;t have SSH on your destination but have FTP&#x2F;SFTP do:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;nvim sftp:&#x2F;&#x2F;[user]@[host]&#x2F;path&#x2F;to&#x2F;file&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;NOTE: To be honest I haven&#x27;t been able to actually work with files in remote sessions with nvim.
I haven&#x27;t gotten much time to troubleshoot it, but I will update with my experiences.
If you know how to work with remote file systems, &lt;a href=&quot;&#x2F;contact&quot;&gt;contact me&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
