> 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.
:h :mks
10. If a file exists with the same name as the Session file, but ending in
"x.vim" (for eXtra), executes that as well. You can use *x.vim files to
specify additional settings and actions associated with a given Session,
such as creating menu items in the GUI version.
--
Andy
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment