Vim updating currently viewed file
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 ?
The command :e with no parameters will do that.
: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.
Also you can do :set autoread if you are just viewing the file without changing it.
: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).
精彩评论