]> git.phdru.name Git - dotfiles.git/blobdiff - .vim/ftplugin/python.vim
.mc/mc.ext: Add a regex for zip archives
[dotfiles.git] / .vim / ftplugin / python.vim
index c2367b661b124378e7aad6b96aea3893bd0c03db..2aa92b056598bd9d44867b268ee8e7cd3cf762e0 100644 (file)
@@ -39,8 +39,14 @@ function! SavePython()
       if ext != "py"
          !rm -f %[co]
       endif
+      if executable(expand('%:p')) || !executable('chmod')
+        return
+      endif
       if getline(1) =~ "^#!"
          !chmod +x %
+         if v:shell_error
+            echoerr 'Cannot make file executable: ' . v:shell_error
+         endif
       endif
    endif
 endfunction