1

This question already has an answer here:

Let's say I have a text file opened in vim. I'd like to be able to edit this file from bash, let's say with the command echo "text" >> file while the file is already opened in vim. Ideally, vim would just refresh the new content and wouldn't bother with a .swp file, asking for what version I want to restore. Any idea how to do this?

marked as duplicate by Martin Tournoij Jul 21 '16 at 23:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

I believe the option you're looking for is autoread. To use it put this in your vimrc:

set autoread

From :h 'autoread':

When a file has been detected to have been changed outside of Vim and it has not been changed inside of Vim, automatically read it again. When the file has been deleted this is not done.

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