How to automatically make shell script executable with vim?
on Unix/Linux Platform
Add a line like this into your ~/.vimrc:<br>au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "sh" | silent !chmod a+x <afile> | endif | endif</br>This will have vim automatically change the file to executable if the first line contains both "#!" and "sh", such as "#! /bin/sh".