]> git.phdru.name Git - dotfiles.git/blobdiff - .vimrc
Fix(.shellrc): Fix directory name: bash_completion -> bash-completion
[dotfiles.git] / .vimrc
diff --git a/.vimrc b/.vimrc
index bb97edbbe8e9e16a6bea41408283798516eede09..052ace0c2411344db22847dbfc9cab5f661c1183 100644 (file)
--- 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 <buffer> call _BufChangedCB()"
       if a:x && !fx
          !chmod a+x %
       elseif !a:x && fx
@@ -601,9 +600,11 @@ if executable('chmod')
          echoerr 'Error running chmod: ' . v:shell_error
       endif
       checktime
-      execute "au! FileChangedShell " . fname
    endfunction
-   command! Xbit if executable(expand("%:p")) | call SetExecutableBit(0) | else | call SetExecutableBit(1) | endif
+   function! _BufChangedCB()
+      execute "au! FileChangedShell <buffer>"
+   endfunction
+   command! ToggleXbit if executable(expand("%:p")) | call SetExecutableBit(0) | else | call SetExecutableBit(1) | endif
 endif