Loading ...
Sorry, an error occurred while loading the content.

Problem with "without Cream" vim-7.2.303 _vimrc

Expand Messages
  • Gary Johnson
    The version of _vimrc installed by the Cream vim without Cream installer appears to be an obsolete version and contains a MyDiff() that doesn t work. I
    Message 1 of 4 , Dec 1, 2009
    • 0 Attachment
      The version of _vimrc installed by the Cream vim "without Cream"
      installer appears to be an obsolete version and contains a MyDiff()
      that doesn't work.

      I recently installed vim-7.2.303 from the "without Cream" download
      page, http://sourceforge.net/projects/cream/files/Vim, onto a device
      running Windows XP. I needed a better editor than Notepad, but I
      didn't want to install all my usual Vim customizations, so I just
      stuck with the default _vimrc.

      That worked OK until I tried diffing a pair of buffers. Executing

      :windo diffthis

      resulted in

      Error detected while processing function MyDiff:
      line 4:
      E10: \ should be followed by /, ? or &
      E810: Cannot read or write temp files
      E97: Cannot create diffs

      Here is MyDiff() from that _vimrc:

      function MyDiff()
      let opt = ''
      if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
      if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
      silent execute '\"!C:\Program Files\vim\diff\" -a ' . opt . v:fname_in . ' ' . v:fname_new . ' > ' . v:fname_out
      endfunction

      Among other problems, it tries to execute a file that doesn't exist:
      diff.exe is in the vim\vim72 directory, not in the vim directory.

      I replaced that _vimrc with the one that came with the original
      vim-7.2 package from vim.sf.net (2008-08-11) and which has this
      version of MyDiff() instead:

      function MyDiff()
      let opt = '-a --binary '
      if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
      if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
      let arg1 = v:fname_in
      if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
      let arg2 = v:fname_new
      if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
      let arg3 = v:fname_out
      if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
      let eq = ''
      if $VIMRUNTIME =~ ' '
      if &sh =~ '\<cmd'
      let cmd = '""' . $VIMRUNTIME . '\diff"'
      let eq = '"'
      else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
      endif
      else
      let cmd = $VIMRUNTIME . '\diff'
      endif
      silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
      endfunction

      With that _vimrc, the diff I was trying to execute works fine.

      Regards,
      Gary


      --
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • James Vega
      ... Letting them know would probably work better as I m not sure their developers watch this list. Their mailing list info is at
      Message 2 of 4 , Dec 1, 2009
      • 0 Attachment
        On Tue, Dec 1, 2009 at 5:49 PM, Gary Johnson <garyjohn@...> wrote:
        > The version of _vimrc installed by the Cream vim "without Cream"
        > installer appears to be an obsolete version and contains a MyDiff()
        > that doesn't work.

        Letting them know would probably work better as I'm not sure their
        developers watch this list. Their mailing list info is at
        <https://lists.sourceforge.net/lists/listinfo/cream-general>.

        --
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
      • Steve Hall
        ... Thanks for your helpful bugfix, I will change this for the next build. -- Steve Hall [ digitect dancingpaper com ] -- You received this message from the
        Message 3 of 4 , Dec 1, 2009
        • 0 Attachment
          On Tue, 2009-12-01 at 14:49 -0800, Gary Johnson wrote:
          > The version of _vimrc installed by the Cream vim "without Cream"
          > installer appears to be an obsolete version and contains a MyDiff()
          > that doesn't work.

          Thanks for your helpful bugfix, I will change this for the next build.

          --
          Steve Hall [ digitect dancingpaper com ]


          --
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
        • John Beckett
          ... Sorry, I should have reported this to Steve because the issue came up on the wiki. I put my understanding of the problem and the best solution for a user
          Message 4 of 4 , Dec 1, 2009
          • 0 Attachment
            Steve Hall wrote:
            >> The version of _vimrc installed by the Cream vim "without
            >> Cream" installer appears to be an obsolete version and
            >> contains a MyDiff() that doesn't work.
            >
            > Thanks for your helpful bugfix, I will change this for the
            > next build.

            Sorry, I should have reported this to Steve because the issue
            came up on the wiki. I put my understanding of the problem and
            the best solution for a user here:
            http://vim.wikia.com/wiki/Running_diff

            We are talking about Windows systems, and I think the "best
            solution" is to install the GnuWin32 diff package (I believe
            that all that is needed is to copy the *.exe/*.dll files into a
            directory in your PATH).

            Then make sure _vimrc does NOT do this:
            set diffexpr=MyDiff()
            and you can delete the entire MyDiff() function.

            When that occurs, Vim runs diff with standard options and
            everything works. I believe that MyDiff() is simply to convert
            "standard" diff options issued by Vim to options that are
            understood by whatever diff is available on a non-standard
            system.

            I'm not sure how the Cream install can best solve the problem.
            If the Vim directory is placed in the PATH, and if licensing
            allows, putting the current GnuWin32 files in the Vim directory
            would be best (and remove diffexpr + MyDiff from _vimrc).

            John

            --
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
          Your message has been successfully submitted and would be delivered to recipients shortly.