Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go back and return to same location in file listing in Vim netrw?

Tags:

vim

netrw

When browsing a local directory using Vim and the built-in netrw file browsing support, I would like to open a file to view it and then return to the same location in the file listing where I was before opening the file.

The way I usually browse files is to open a file by pressing Enter in netrw, and then when I am done looking at the file, and I want to return to the file listing, I press Ctrl+o to go back to the netrw view, but the cursor always goes back to the top of the file listing, which is very inconvenient when I am browsing a typical directory. I would like to go back to the same location in the file listing where I was when I pressed Enter to open the file.

I know that I can open the file in a split window by pressing o in the netrw file listing view, instead of Enter to open it in the same window, but I don't want to split the view: I want to use the whole view for the file until I am done looking at it, and then I want to go back to the same place in the file list to potentially open the next file in the list.

like image 770
Colin D Bennett Avatar asked Dec 08 '22 04:12

Colin D Bennett


1 Answers

Use :Rex to resume exploring. See :h :Rex

like image 104
Peter Rincker Avatar answered Dec 28 '22 23:12

Peter Rincker