Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i get the previous directory list after opening a file from directory/file list?

Tags:

vim

editor

vim .

Now selecting a file I opened it, now how can I get back the previous window with that vim .?

like image 207
shibly Avatar asked Oct 26 '11 10:10

shibly


2 Answers

If you try to edit a directory (like vim .) you get the directory explorer. Edit inside vim:

:e .

Thanks to jumplists, one can back up to the directory browser with Ctrl+O in normal mode. That will work best if you don't jump between files in the between.

like image 165
mike3996 Avatar answered Oct 15 '22 00:10

mike3996


C-o will go back to the listing but the cursor will be at the end of the listing

C-^ will go back to the listing too, but the cursor will be at the beginning of the listing (e.g. the .. line)

Does anyone know that how to go back the the previous line of the listing, I mean, if I open a file at the 5th line in the listing, when finishing viewing/editing that file, how to go back the position of 5th line in the listing?

like image 34
CodyChan Avatar answered Oct 15 '22 02:10

CodyChan