Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Problem at vim startup...

Viki
Erik Timan
2007-06-23
2013-04-17
  • Erik Timan
    Erik Timan
    2007-06-23

    Hello!

    I wanted to try your vim "viki" after using MuseMode in Emacs for a while.

    But after installing (with vimball) both tlib and viki I get an error message when starting vim:

    Error detected while processing /home/erik/.vim/plugin/viki.vim:
    line  231:
    E121: Undefined variable: g:netrw_browsex_viewer
    E15: Invalid expression: "exec 'silent !". g:netrw_browsex_viewer ." '. escape('%{FILE}', ' &!%')"

    I don't know if it is related, but sometimes when I edit text in VikiMode, vim seemes to freeze and I cannot get out of insert mode. There is an error flashing by when I activate VikiMode, something about "E108: No such variable: 'b:did_ftplugin'"...

    I'm using vim 7.0.243 under Arch Linux.

    Any help would be appreciated!

    /Erik

     
    • Tom Link
      Tom Link
      2007-06-23

      g:netrw_browsex_viewer is supposed to be defined by the netrw plugin that comes with vim. For whatever reason, it isn't.

      You can avoid the problem by defining g:vikiOpenFileWith_ANY in ~/.vimrc. Possible values are:

      if !exists("g:vikiOpenFileWith_ANY") "{{{2
          if has("win32")
              let g:vikiOpenFileWith_ANY = "exec 'silent !cmd /c start '. escape('%{FILE}', ' &!%')"
          elseif $GNOME_DESKTOP_SESSION_ID != ""
              let g:vikiOpenFileWith_ANY = "exec 'silent !gnome-open '. escape('%{FILE}', ' &!%')"
          elseif $KDEDIR != ""
              let g:vikiOpenFileWith_ANY = "exec 'silent !kfmclient exec '. escape('%{FILE}', ' &!%')"
          endif
      endif

      > I don't know if it is related, but sometimes when I edit text in
      > VikiMode, vim seemes to freeze and I cannot get out of insert mode.

      Could you please define "sometimes"? Does this happen when you press a certain key? Does it happen when you type a syntactic entity (eg a table row)?

      > There is an error flashing by when I activate VikiMode, something about
      > "E108: No such variable: 'b:did_ftplugin'"...

      Does this happen all the time or only "sometimes"? Could you please post
      a exact sequence of commands causing this problem? I assume you have
      these options set:

          set nocompatible
          filetype plugin indent on
          syntax on

       
    • Tom Link
      Tom Link
      2007-06-23

      > I don't know if it is related, but sometimes when I edit text in
      > VikiMode, vim seemes to freeze and I cannot get out of insert mode.
      > There is an error flashing by when I activate VikiMode, something about
      > "E108: No such variable: 'b:did_ftplugin'"...

      Okay, please use

      set ft=viki

      instead.

      Or change the respective line in following function
      plugin/viki.vim
      > function! VikiMode(state) "{{{3
      >     unlet b:did_ftplugin

      Make this: unlet! b:did_ftplugin

      >     set filetype=viki
      > endf

       
    • Erik Timan
      Erik Timan
      2007-06-23

      Ok, errors fixed. Thanks!

      After applying some trial-and-error, I've found that my freeze problems are related to not using a heading at the very first line in a file.

      How to produce the error: create a new file, leave the first line blank, and create a new heading at line 2. And there it freezes. If I do create a heading at line 1, everything works as expected. Is it just me doing something stupid, or is this an error of some kind?

      Thank you for your time!

       
      • Tom Link
        Tom Link
        2007-06-24

        It seems the problem is that the heading is on the last line. This problem never occurred to me as I usually have a vi modeline there. I'll upload a new version later today.

         
        • Erik Timan
          Erik Timan
          2007-06-24

          Just tried the new version. Everything works fine now.

          I did find another small glitch, but related to the (new) cache. If I try to :set ft=viki while in a new, empty and unassociated buffer, I get the following error: "E482: Can't create file /home/erik/.vim/cache/viki_inexistent/_/". I suppose this is expected when in a buffer without an associated file, but I just wanted to make you aware of this.

          Again, thank you for all your hard work on both viki and deplate.

           
          • Tom Link
            Tom Link
            2007-06-24

            No, it isn't expected. But it's kind of you to say so. :-) I uploaded new versions of viki and tlib.

             
    • Martial Boniou
      Martial Boniou
      2008-12-20

      I got quite the same problem not being able to open an URL on MacVim (Mac OS X). I fixed it with:
      if has("mac")
      let g:vikiOpenUrlWith_ANY = "exec 'silent !open '. escape('%{URL}', ' &!%')"
      endif

      It could be nice to add this line in the viki plugin to avoid that new users go to Emacs Muse. 'open' command is a generic NEXTSTEP/OS X shell to launch any application according to the mimetype.

      I am just starting to use Viki and it looks really nice.

      Thanks Thomas for your work.

       
      • Tom Link
        Tom Link
        2008-12-21

        Hi,

        Thanks for the tip.

        Does this work too:

                let g:vikiOpenFileWith_ANY = "exec 'silent !open '. shellescape('%{FILE}')"

        Would this open a pdf file, eg [[test.pdf]]?

         
        • Martial Boniou
          Martial Boniou
          2008-12-21

          Hi,

          yes it works like a charm,

          Thank you