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

How do I open a file explorer in a vertical split without any plugins?

Answer

:Vexplore

Explanation

Vim ships with netrw, a built-in file explorer that requires no plugins. The :Vexplore command opens the explorer in a vertical split to the left, giving you a sidebar-style file browser while keeping your current file visible.

How it works

  • :Vexplore opens netrw in a vertical split on the left
  • Navigate with j/k and press <CR> to open a file
  • The file opens in the adjacent window, replacing the previous buffer
  • Press - to go up one directory

Example

Starting with a single file open:

+-------------------------+
|     your_file.py        |
+-------------------------+

After :Vexplore:

+-----------+-------------+
| netrw     | your_file.py|
| ../       |             |
| src/      |             |
| README.md |             |
+-----------+-------------+

Tips

  • :Hexplore opens the explorer in a horizontal split below
  • :Sexplore opens in a horizontal split above
  • :Explore opens the explorer in the current window
  • Set let g:netrw_winsize = 25 in your vimrc for a 25% width sidebar
  • Press i in netrw to cycle through listing styles (thin, long, wide, tree)
  • Press % in netrw to create a new file

Next

How do I visually select a double-quoted string including the quotes themselves?