Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I have a file open in vim, in this case a log file, I'd like to trigger a refresh and load any file changes into my existing vim session.

I often use tail -f on log files, but as I'm using java and tomcat, the log messages are too much for tail...

Is there a vim command to reload an open file?

share|improve this question
1  
too much for tail? even as a vim user i dont see how vim can improve the situation ... – akira Feb 17 '11 at 17:40
possible duplicate of Tips for using vim as a log viewer – akira Feb 17 '11 at 17:42
too much for tail in that the number of lines was unpredictable so I couldn't be sure that tail -f n 200 would be enough – mcgyver5 Feb 17 '11 at 17:54

1 Answer

up vote 9 down vote accepted

Give this a try:

:e

From :h :e:

Edit the current file. This is useful to re-edit the current file, when it has been changed outside of Vim.

share|improve this answer
thanks! I thought at one point :e wasn't working for me but it works now! – mcgyver5 Feb 17 '11 at 17:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.