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

Re: Viewing substitute command changes

Expand Messages
  • Yegappan Lakshmanan
    Hello, ... You can try using the following greplace plugin: http://vim.sourceforge.net/scripts/script.php?script_id=1813 - Yegappan
    Message 1 of 5 , Jul 20, 2007
      Hello,

      On 7/20/07, Pavel Shevaev <pacha.shevaev@...> wrote:
      >
      > Hi, folks!
      >
      > Is it possible somehow to put all substitute changes into quickfix window?
      >
      > Well, there are "n" and "p" flags however being able to browse all
      > changes with :cn, :cope commands could be much more convenient imho.
      > This could be especially helpful for viewing changes in multiple files
      > after applying :argdo %s/../../
      >
      > Any tips?
      >

      You can try using the following greplace plugin:

      http://vim.sourceforge.net/scripts/script.php?script_id=1813

      - Yegappan

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • John Little
      ... Well, here s the backup function I used with vim 7 on windows, but at work I m presently using 6.3 that comes with Red Hat, and the globpath() call works
      Message 2 of 5 , Jul 21, 2007
        > Could you please share your .vimrc settings for this trick?

        Well, here's the backup function I used with vim 7 on windows, but at
        work I'm presently using 6.3 that comes with Red Hat, and the
        globpath() call works quite differently, it never returns the empty
        string; for each dir in the backupdir option it always returns an
        entry for the file, whether it exists or not. I'll have to loop on
        the string returned by globpath calling filereadable(), or, get vim 7
        somehow, without involving administrators. (The dilemma has put the
        problem in the too hard pile.)

        HTH, John

        function! StampBackup()
        let bup = globpath(&backupdir, expand('%:t') . &bex)
        if bup != ""
        let stamp = ".".strftime("%y.%m.%d_%H.%M.%S")."."
        let stamped = substitute(bup, '\M.\(\[^.]\*\)' . &bex, stamp . '\1', '')
        if stamped == bup " file has no suffix
        let stamped = substitute(bup, '\M' . &bex, stamp . &bex, '')
        endif
        if rename(bup, stamped)
        echoerr "failed rename of backup " . bup . " to " . stamped
        endif
        endif
        endfunction

        augroup StampBackup
        au! BufWritePost * call StampBackup()
        augroup END

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Tony Mechelynck
        John Little wrote: [...] ... [...] 6.3 is obsolete by now. Since its days, both 6.4 and 7.0 have come and gone, and the current version, 7.1, is at patchlevel
        Message 3 of 5 , Jul 22, 2007
          John Little wrote:
          [...]
          > Well, here's the backup function I used with vim 7 on windows, but at
          > work I'm presently using 6.3 that comes with Red Hat, and the
          > globpath() call works quite differently, it never returns the empty
          > string; for each dir in the backupdir option it always returns an
          > entry for the file, whether it exists or not. I'll have to loop on
          > the string returned by globpath calling filereadable(), or, get vim 7
          > somehow, without involving administrators. (The dilemma has put the
          > problem in the too hard pile.)
          >
          > HTH, John
          [...]

          6.3 is obsolete by now. Since its days, both 6.4 and 7.0 have come and gone,
          and the current version, 7.1, is at patchlevel 32. You should be able to
          compile it yourself, it is not very difficult. See how I do it at
          http://users.skynet.be/antoine.mechelynck/vim/compunix.htm

          If you don't have admin privileges, you ought to be able to install it
          somewhere under your home directory (e.g. equating $VIMRUNTIME with
          $HOME/vim/vim71 with no dot before vim). In that case the harder difficulty
          may be to make sure that all needed "development" packages are installed on
          the system.

          Or else (this would be better if you can pull it off) convince your admin that
          he has obsolete software installed; you may even offer to bring it up-to-date ;-)


          Best regards,
          Tony.
          --
          f y cn rd ths thn y cn hv grt jb n cmptr prgrmmng

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • John Little
          ... Yes, but it s still very, very good... Further finding: Vim 6 s glob() functions misbehave *only* with a tilde in the file name (or names). Changing
          Message 4 of 5 , Jul 25, 2007
            Tony said:

            >6.3 is obsolete by now....

            Yes, but it's still very, very good...

            Further finding: Vim 6's glob() functions misbehave *only* with a tilde in the file name (or names).  Changing &backupext to something else solves the problem.  I wonder what

                :echo glob("xyzzy~")

            says with Vim 7 and unix etc. (assuming there's no such file about).  Looks like some tilde expansion effect, though the

            >You should be able to compile it yourself...

            Yeah, but that's not what the client is paying me for.  It's a development shop where they're really keen on developer boxes having the 'standard build' and it's quite involved to get that build changed; they do lots of pair programming swapping around every day.  I'll have to put together "Vim on a stick" so that I can carry it around.

            Regards, John

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

          • fREW
            ... Portable vim is available for windows boxes. If you do put portable vim on a usb key I would suggest writing a script that will update your .vimrc as it
            Message 5 of 5 , Jul 25, 2007
              > Yeah, but that's not what the client is paying me for. It's a development
              > shop where they're really keen on developer boxes having the 'standard
              > build' and it's quite involved to get that build changed; they do lots of
              > pair programming swapping around every day. I'll have to put together "Vim
              > on a stick" so that I can carry it around.

              Portable vim is available for windows boxes. If you do put portable
              vim on a usb key I would suggest writing a script that will update
              your .vimrc as it tends to lag behind the version on your computer
              otherwise.

              --
              -fREW

              Q: Why is this email 5 sentences or less?
              A: http://five.sentenc.es

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