Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIM: How can i refresh directory with vim?

Tags:

vim

editor

vim .

I have renamed some folders in current directory(.).

Now how can I refresh this directory in vim?

like image 934
shibly Avatar asked Oct 27 '11 07:10

shibly


People also ask

How to refresh a file in vim?

The command you want is :e (short for :edit ). If you use :edit! it will discard local changes and reload. You can also have vim do this automatically with set autoread in your vimrc.

How do I navigate folders in vim?

Select a file or directory name and press Enter to open that file or directory. (For example :e /home/user displays the contents of that directory.) To return to the explorer window, press Ctrl-^ (usually Ctrl-6). You can also "edit" a directory to explore that directory.

How do you go back a folder in vim?

You can use Ctrl - O to go back to the previous buffer.


2 Answers

You can use the command :edit to reload the current file/dir listing.

like image 94
Oldskool Avatar answered Nov 03 '22 23:11

Oldskool


From the docs:

To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or hit the <cr> when atop the ./ directory entry in the listing. One may also refresh a local directory by using ":e .".

like image 39
Eugene Yarmash Avatar answered Nov 03 '22 23:11

Eugene Yarmash