I'm primarily a
User Developer Sysadmin A mixture Something else entirely .. ( 461 votes ~ 10 comments )
You are not currently logged in. If you do not have a user account then please consider creating one and logging in before you post your comment. This will allow you to track replies to your comment, and take part in the site much more freely.
To add your comment, fill in all the boxes below and then preview it to make sure you're happy with the way that it looks.
This is the comment you were replying to, attached to the article Making shell scripts executable via editor hooks:
#7 Re: Making shell scripts executable via editor hooks Posted by Anonymous (165.200.xx.xx) on Thu 6 Dec 2007 at 23:03 I am same poster as parent... ended up doing a little research and chaged the vim code. Put this in my .vimrc and not getting errors anymore: " automatically give executable permissions if file begins with #! and contains " '/bin/' in the path function ModeChange() if getline(1) =~ "^#!" if getline(1) =~ "/bin/" silent !chmod a+x endif endif endfunction au BufWritePost * call ModeChange() not sure why the originally posted code didn't work... Thanks so much for the idea of doing this within .vimrc, and for giving the impetus to do some vimrc research ;)
" automatically give executable permissions if file begins with #! and contains " '/bin/' in the path function ModeChange() if getline(1) =~ "^#!" if getline(1) =~ "/bin/" silent !chmod a+x endif endif endfunction au BufWritePost * call ModeChange()
Posting Format:
Inappropriate comments will be removed.
Some help on entry formatting is available
Username:
Password:
[ Advanced Login ]
Register Account