How to define intervikis

Viki
ashcatch
2008-01-10
2013-04-17
  • ashcatch
    ashcatch
    2008-01-10

    Hi,

    what is the best way to define an interviki location?

    The documentation says to do

        call viki#Define(...)

    but also mentions VikiDefine and "Viki BibTeX" sections mentions

        let g:vikiInterBIB         = $HOME ."/local/share/texmf/bibtex/bib/tml"
        let g:vikiInterBIB_suffix  = ".bib"

    So which one should you use? And in which file should you do it?

    Currently, I use

        call viki#Define(...)

    in ~/.vim/after/ftplugin/viki.vim which works. The only problem is that if I start vim with a file that has an interviki link, the link is marked red even if the file is there. If I reopen the file in the same vim instance or if I start vim with another viki file and then open the file with the interviki link, the link is marked correctly as blue (existing).

    So I guess that doing the interviki define in ~/.vim/after/ftplugin/viki.vim seems to be too late (i.e. the file is already open when the definition is read).

    Rainer

     
    • Tom Link
      Tom Link
      2008-01-10

      > but also mentions VikiDefine and "Viki BibTeX" sections mentions
      >
      >     let g:vikiInterBIB         = $HOME ."/local/share/texmf/bibtex/bib/tml"
      >     let g:vikiInterBIB_suffix  = ".bib"

      This is outdated information. Thanks for pointing this out.
      viki#Define(...) definitely is the right solution.

      > So I guess that doing the interviki define in ~/.vim/after/ftplugin/viki.vim

      Try ~/.vim/after/plugin/viki.vim

      The reason you can't put it into ~/.vimrc is because some variables and 
      functions aren't defined yet when loading this file. Since vim7 has
      dictionnaries, one could think of using a global variable for defining
      intervikis again, which would solve this problem.

      Calling viki#Define(...) loads autoload/viki.vim though. I'm not sure if
      after/autoload/viki.vim would work.

      Regards,
      Thomas.

       
      • ashcatch
        ashcatch
        2008-01-10

        > Try ~/.vim/after/plugin/viki.vim

        This worked fine. Thanks.

        Rainer