Hello everybody,

I have a function that tries to regenerate a project's tag file
automatically:

function! SetProject()
    let name = substitute(v:this_session, '.*\(/\|\\\)', '', '')
    if name == ''
        let name = input('Project name: ')
    endif
    let $PROJDIR = input('Base directory for the project: ')
    let ctags_cmd = 'ctags -R --fields=+iaS --extra=+q -f ~/.vim/
tags/' . name . ' ' . $PROJDIR
    let output = system(ctags_cmd)
    execute 'set tags=~/.vim/tags/' . name
    execute 'au BufWritePost * silent! !' . ctags_cmd
endfunction

After that, I just save the session. The problem is that next time I
open it, the BufWritePost event is not set; I'd kinda hoped that it
would be after I'd sourced the session. I messed around a bit with
'ssop', tried adding globals to that, but it didn't work.

Is is possible to run this function once and then have BufWritePost
set correctly every time I source the session?

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

Reply via email to