Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make every file that start with shebang to be executable by default, so I use the following line in my vimrc,

au BufWritePost * if getline(1) =~ "^#!" | silent !chmod a+x <afile>

VIM asks me if I want to reload everytime I write the file:

enter image description here

Any way to avoid that?

share|improve this question

According to the VIM manual for Warning 16, you just need to add autoread. Take a look at the help info for it by typing, :help autoread.

share|improve this answer
Now that I have been playing with this for a while, I can't actually get your initial example to work. What version of VIM are you using? – sparticvs Oct 28 '12 at 13:39

Your Answer


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.