X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.vimrc;h=0ff6ea1ec534ac8bde907caba3e627d601bb0d86;hb=a1c31b2ff900db13e664bdd49ecb236350da2bb0;hp=052ace0c2411344db22847dbfc9cab5f661c1183;hpb=8411a454724dd8e6da1bfc13419b261571c9cc82;p=dotfiles.git diff --git a/.vimrc b/.vimrc index 052ace0..0ff6ea1 100644 --- a/.vimrc +++ b/.vimrc @@ -589,12 +589,13 @@ endif if executable('chmod') function! SetExecutableBit(x) checktime + " Avoid 'Reload Y/N?' question + autocmd FileChangedShell call _BufChangedCB() let fx = executable(expand("%:p")) - execute "au FileChangedShell call _BufChangedCB()" 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 @@ -602,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