Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.