Go to reverse directory lookup after opening file in vim

When I open the directory view in vim, I can open the file by moving the cursor to the file name and pressing Enter .

Now, is there any command to return to the previous directory browsing?

If not, is there a way to open the file without closing the directory view?

+51
vim
Feb 06 2018-12-12T00:
source share
5 answers

You can return to the last buffer using :b# .

If you just opened the file, it will return you to viewing directories.

Update : Since this answer turned out to be acceptable as the correct answer and thus at the top, I would like to summarize the answers, including @romainl, that imho is correct.

  • :Rex[plore] : Return to explorer (by @romainl) vimdoc.sourceforge
  • :Ex : opens the explorer, but does not have to be the same (at @ drug_user841417). See vim.wikia
  • :b# : returns to the "previously edited buffers". See vim.wikia
  • Ctrl - O : return to the previous (older) location, not necessarily to the buffer (by @Peyman). See vim.wikia
+99
Feb 06 2018-12-12T00:
source share

You can use Ctrl - O to return to the previous buffer.

+63
Feb 07 2018-12-12T00:
source share

:Ex will return you (and show you what you edited and not saved).

+19
Sep 07
source share

The correct command to return to the netrw list is :Rex[plore] . You can run it even after you jump into dozens of files and from them.

+14
Dec 25 '12 at 11:12
source share

I rely on Ctrl ^ to go back and forth b / w two buffers.

+12
Apr 17 '13 at 21:50
source share



All Articles