From: Oleg Broytman Date: Tue, 4 Jul 2017 20:46:02 +0000 (+0300) Subject: Feat(.vim/ftplugin/python.vim): Do not call chmod if not required X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=af73ed15dc0833c4ad1416019d9497d0ad50b33c;hp=9169df51588c4172babd3233ca28ed01b0f6ef92;p=dotfiles.git Feat(.vim/ftplugin/python.vim): Do not call chmod if not required Do not call chmod if the script is already executable or chmod is not available in the wrong OS. --- diff --git a/.vim/ftplugin/python.vim b/.vim/ftplugin/python.vim index c2367b6..75f2e51 100644 --- a/.vim/ftplugin/python.vim +++ b/.vim/ftplugin/python.vim @@ -39,6 +39,9 @@ function! SavePython() if ext != "py" !rm -f %[co] endif + if executable(expand('%:p')) || !executable('chmod') + return + endif if getline(1) =~ "^#!" !chmod +x % endif