tags:

views:

55

answers:

4

Im just curious if im viewing a file e.g. x.log which is currently being updated ie a log file. Is there a way to effectively refresh it rather than :q and vim x.log it again ?

+5  A: 

The command :e with no parameters will do that.

Colin Newell
A: 

:e reloads the current file. Use :e! if you made any changes. You can assign a key to it like this:

nmap <F1> :e^M

Where ^M is a literal control-M (use control-V in vi).

Walter H
A: 

:edit with no other parameters will reload the current file.

:edit! to discard changes first.

Also gvim will prompt you to reload a file if you switch to another program and back, and it detects that the file has changed.

Dave Kirby
+1  A: 

Also you can do :set autoread if you are just viewing the file without changing it.

skeept