git – Refresh all files in buffer from disk in vim

Question:

The command to refresh a file from version on disk is :e!

How can I do the same for all files in the buffer?

Background: I need that because I am using git with multiple branches with one vim open that contains a buffer. When I checkout a branch, I would like to have vim refresh.

Answer:

Read the documentation for bufdo, it should do what you want.

Leave a Reply