From af73ed15dc0833c4ad1416019d9497d0ad50b33c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 4 Jul 2017 23:46:02 +0300 Subject: [PATCH 1/1] 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. --- .vim/ftplugin/python.vim | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.2