au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod a+x | endif | endif
The given directive checks the first line of the saved file and, if it starts with "#!" and contains "/ bin /", assigns the last executable attribute.
Source: shell-fu .
Source: https://habr.com/ru/post/63904/
All Articles