X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.vimrc;h=0ff6ea1ec534ac8bde907caba3e627d601bb0d86;hb=904a5914057b2f40c37534072c2c4ae7243e9076;hp=ab3609ebcf5a5d74a35ac9ebe0e1aa7ffcb21b3a;hpb=fefb347090ff343f13ad354b9472e68d6a36e4a8;p=dotfiles.git diff --git a/.vimrc b/.vimrc index ab3609e..0ff6ea1 100644 --- a/.vimrc +++ b/.vimrc @@ -589,13 +589,13 @@ endif if executable('chmod') function! SetExecutableBit(x) checktime - let fname = expand("%:p") - let fx = executable(fname) - execute "au FileChangedShell call _BufChangedCB()" + " Avoid 'Reload Y/N?' question + autocmd FileChangedShell call _BufChangedCB() + let fx = executable(expand("%:p")) if a:x && !fx - !chmod a+x % + silent !chmod a+x % elseif !a:x && fx - !chmod a-x % + silent !chmod a-x % endif if v:shell_error echoerr 'Error running chmod: ' . v:shell_error @@ -603,7 +603,7 @@ if executable('chmod') checktime endfunction function! _BufChangedCB() - execute "au! FileChangedShell " + autocmd! FileChangedShell endfunction command! ToggleXbit if executable(expand("%:p")) | call SetExecutableBit(0) | else | call SetExecutableBit(1) | endif endif