i
- 2024-09-24 - 2024/09/24/W11-Warning-File-has-changed-since-editing-started/

Occasionally I need to look at log files on a server to try and debug an issue. Sometimes I just tail the log file and watch it scroll by. This works most of the time on a dev instance. But on a production instance, there’s typically way too much activity, so often I’ll use trusty old vim so that I can scroll through, search, etc.

Unfortunately, a lot of times with an actively changing log file, vim will try to helpfully let you know that the file has been modified since you began editing. In a lot of cases, that is helpful, but in this scenario, it’s just plain annoying.

After repeatedly hitting “O” for OK or “L” to reload the file, I finally decided I needed to figure out how to make this go away. I found the answer!

In Vim, enter the following

:set autoread

Now, get to figuring out that bug!

Author: S. Eric Asberry
URL: https://blog.ericasberry.com/2024/09/24/W11-Warning-File-has-changed-since-editing-started/
keyboard_arrow_up