vimtricks.wiki Concise Vim tricks, one at a time.

How do I toggle the display of hidden dot-files in Vim's built-in netrw file browser?

Answer

gh (in netrw)

Explanation

When browsing files with Vim's built-in netrw file explorer (:Explore or :Ex), hidden files starting with a dot (.gitignore, .env, etc.) are hidden by default. Press gh to toggle their visibility on or off without leaving the explorer.

How it works

  • gh — toggles the netrw_hide setting for the current netrw buffer, showing or hiding dotfiles
  • When dotfiles are shown, they appear alongside regular files in whatever listing style is active
  • The toggle is per-session; it does not persist across Vim restarts unless you set g:netrw_hide = 0 in your config

Example

Open the file explorer with:

:Explore

You see only regular files. Press gh to reveal dotfiles:

  .env
  .gitignore
  .nvimrc
  README.md
  src/

Press gh again to hide them.

Tips

  • To show dotfiles by default, add let g:netrw_hide = 0 to your .vimrc
  • g:netrw_list_hide accepts a comma-separated list of patterns to hide — you can add your own (e.g., *.pyc files)
  • Other useful netrw toggles: i cycles through listing styles (thin, long, wide, tree), a cycles through hide/show/all modes
  • See :help netrw-gh for full details

Next

How do I mark and delete multiple files at once from within Vim's built-in file explorer netrw?