On Thursday 24 September 2009, Harry Putnam wrote:

> Can anyone tell me how to do that... or maybe just write a
> separate setting that causes the file to be chmod to 755 on
> save.

with the following in your .vimrc:

"http://vim.wikia.com/wiki/Setting_file_attributes_without_reloading_a_buffer
function! SetExecutableBit()
    if &modified
        write
    endif
    let fname = expand("%:p")
    checktime
    execute "au FileChangedShell " . fname . " :echo"
    silent !chmod 754 %
    checktime
    execute "au! FileChangedShell " . fname
endfunction
command! Xbit call SetExecutableBit()

the command :Xbit will set the executable bit (to 754 -- you 
can change that) as well as save

i think i added the save and 754 to the original tip

sc

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to