add the following lines to the end of your ~/.vimrc file
Code: Select all
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod a+x <afile> | endif | endif
Once you add #!/bin/sh (for example) to the start of a file and save it, the file will be immediately executable.
755 upon exiting vim.
YMMV...