Neovim for Beginners — File Explorer
Configure file explorer for Neovim, with and without plugins.

Exploring files and directories is what we do daily. Let’s check out how Neovim can help us. We are going to
- Explore
Netrw(:h netrw) which is the built-in file browser supporting local and remote file browsing. - Configure sensible defaults for
Netrwand check outvinegar.vim that enhancesNetrw. - Install and configure
nvim-tree, a Lua-based plugin for Neovim.
This article is part of the Neovim for Beginners series.
The Neovim configuration files can be found in this repository.
Netrw
All Vimmers should have some basic knowledge of Netrw.
Netrw makes reading files, writing files, browsing over a network, and
local browsing easy. It supports many protocols like scp, ftp, http, rsync, sftp, fetch, dav, etc (:h netrw-ref).
We can use it to read a remote file.
nvim scp://hostname/path/to/file
nvim ftp://hostname/path/to/fileWe can use it to browse a remote directory.
nvim scp://hostname/
nvim ftp://hostname/path/to/dir/Local browsing is easy.
nvim . nvim /home/userid/path
Commands
From within Neovim, we can use the :edit or :e commands to browse the directory. E.g. :e $HOME to browse the home directory, or :e . to browse the current directory.
Other available commands are
:[N]Explore[!] [dir]- Explore the directory of the current file.:[N]Hexplore[!] [dir]— Horizontal Split & Explore.:[N]Lexplore[!] [dir]— Left Explorer Toggle.:[N]Sexplore[!] [dir]— Split & Explore the current file’s directory.:[N]Vexplore[!] [dir]— Vertical Split & Explore.:Texplore [dir]— Tab & Explore.:Rexplore— Return to/from the Explorer.

Within Netrw, we can press to see the supported commands for file and directory manipulation, e.g. % to create a file, d to create a folder, R to rename, D to delete, etc.
Configure Netrw
Let’s check out settings we can configure for Netrw (:h netrw-browser-settings).
g:netrw:banner— Enable or suppress the banner. 0 to suppress the banner, 1 to enable the banner (default).g:netrw_altv— Change from left splitting to right splitting.g:netrw_browse_split— When browsing,will open the file by 0: re-using the same window (default), 1: horizontally splitting the window first, 2: vertically splitting the window first, 3: open file in a new tab, 4: act like “P” (i.e. open the previous window).g:netrw_liststyle- Set the default listing style- 0: thin listing (one file per line), 1: long listing (one file per line with timestamp information and file size), 2: wide listing (multiple files in columns), 3: tree-style listing.g:netrw_list_hide- Comma-separated pattern list for hiding files.
In the after/plugin/defaults.lua file, add the following lines.









