X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.vimrc;h=052ace0c2411344db22847dbfc9cab5f661c1183;hb=59e5881d91c20244b189a8899a02cd01bc127af3;hp=1620a5d40ad0b78cd52e498f9a6807d38dbfce5e;hpb=684ab1c2680bcbf04f41a5dc6be809f93376bd2c;p=dotfiles.git diff --git a/.vimrc b/.vimrc index 1620a5d..052ace0 100644 --- a/.vimrc +++ b/.vimrc @@ -589,9 +589,8 @@ endif if executable('chmod') function! SetExecutableBit(x) checktime - let fname = expand("%:p") - let fx = executable(fname) - execute "au FileChangedShell " . fname . " :echo" + let fx = executable(expand("%:p")) + execute "au FileChangedShell call _BufChangedCB()" if a:x && !fx !chmod a+x % elseif !a:x && fx @@ -601,7 +600,9 @@ if executable('chmod') echoerr 'Error running chmod: ' . v:shell_error endif checktime - execute "au! FileChangedShell " . fname + endfunction + function! _BufChangedCB() + execute "au! FileChangedShell " endfunction command! ToggleXbit if executable(expand("%:p")) | call SetExecutableBit(0) | else | call SetExecutableBit(1) | endif endif