Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making vim git aware

Tags:

git

vim

  1. I use Vim & Git together.
  2. I tend to merge/switch Git branches alot.
  3. I tend to have lots of vim buffers open.

  4. Is there a way to tell vim: when I execute this git command (which switches branches), reload all buffers? Since I have hooks into all my vim-git interaction, letting vim know when to do the reload is not a problem. The question is: how to force vim to reload all buffers?

like image 518
anon Avatar asked Apr 27 '26 09:04

anon


1 Answers

You can try setting the autoread option on.

:set autoread

From the vim help:

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.

like image 87
CB Bailey Avatar answered Apr 29 '26 22:04

CB Bailey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!