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

vimdiff case insensitive

Expand Messages
  • marco restelli
    Hi all, this seems a simple question but I can not find any reference: is it possible to have a case insensitive comparison with vimdiff? Thanks! Marco -- --
    Message 1 of 7 , Jul 3, 2014
    • 0 Attachment
      Hi all,
      this seems a simple question but I can not find any reference: is
      it possible to have a case insensitive comparison with vimdiff?

      Thanks!
      Marco

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • marco restelli
      ... OK, I think it is set diffopt+=icase Marco -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you
      Message 2 of 7 , Jul 3, 2014
      • 0 Attachment
        2014-07-03 10:58 GMT+0200, marco restelli <mrestelli@...>:
        > Hi all,
        > this seems a simple question but I can not find any reference: is
        > it possible to have a case insensitive comparison with vimdiff?

        OK, I think it is

        set diffopt+=icase

        Marco

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • marco restelli
        ... Sorry for keeping replying to my own thread, but now there is another detail that I don t understand. Consider the following example, having set
        Message 3 of 7 , Jul 3, 2014
        • 0 Attachment
          2014-07-03 11:08 GMT+0200, marco restelli <mrestelli@...>:
          > 2014-07-03 10:58 GMT+0200, marco restelli <mrestelli@...>:
          >> Hi all,
          >> this seems a simple question but I can not find any reference: is
          >> it possible to have a case insensitive comparison with vimdiff?
          >
          > OK, I think it is
          >
          > set diffopt+=icase

          Sorry for keeping replying to my own thread, but now there is another
          detail that I don't understand. Consider the following example, having
          set diffopt=filler,icase:

          1) if I have two buffers with one line each:
          buffer 1 -> abc this IS a TEST
          buffer 2 -> this IS a TEST

          the characters abc in buffer 1 are highlighted (this is what I would
          expect)

          2) same two buffers, with
          buffer 1 -> abc this IS a TEST
          buffer 2 -> this is a test

          now the complete lines are highlighted in both buffers, while I would
          like to have highlighted only abc, as in the first case.

          Is it possible to have 2) behave exactly like 1), highlighting only
          abs, regardless of the case of the remaining words?

          Marco

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • Christian Brabandt
          ... This is probably caused by the diff command detecting it as 1 deleted line and 1 added line instead of 1 changed line. I don t think, there is much Vim can
          Message 4 of 7 , Jul 3, 2014
          • 0 Attachment
            Am 2014-07-03 11:18, schrieb marco restelli:
            > 2014-07-03 11:08 GMT+0200, marco restelli <mrestelli@...>:
            >> 2014-07-03 10:58 GMT+0200, marco restelli <mrestelli@...>:
            >>> Hi all,
            >>> this seems a simple question but I can not find any reference: is
            >>> it possible to have a case insensitive comparison with vimdiff?
            >>
            >> OK, I think it is
            >>
            >> set diffopt+=icase
            >
            > Sorry for keeping replying to my own thread, but now there is another
            > detail that I don't understand. Consider the following example, having
            > set diffopt=filler,icase:
            >
            > 1) if I have two buffers with one line each:
            > buffer 1 -> abc this IS a TEST
            > buffer 2 -> this IS a TEST
            >
            > the characters abc in buffer 1 are highlighted (this is what I would
            > expect)
            >
            > 2) same two buffers, with
            > buffer 1 -> abc this IS a TEST
            > buffer 2 -> this is a test
            >
            > now the complete lines are highlighted in both buffers, while I would
            > like to have highlighted only abc, as in the first case.
            >
            > Is it possible to have 2) behave exactly like 1), highlighting only
            > abs, regardless of the case of the remaining words?

            This is probably caused by the diff command detecting it as 1 deleted
            line
            and 1 added line instead of 1 changed line.

            I don't think, there is much Vim can do here.


            Best,
            Christian

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          • marco restelli
            ... OK, thank you Christian, then I think the best solution is to copy the two files, pass both of them to lowercase with u in visual mode and use the standard
            Message 5 of 7 , Jul 3, 2014
            • 0 Attachment
              2014-07-03 11:40 GMT+0200, Christian Brabandt <cblists@...>:
              > Am 2014-07-03 11:18, schrieb marco restelli:
              >> 2014-07-03 11:08 GMT+0200, marco restelli <mrestelli@...>:
              >>> 2014-07-03 10:58 GMT+0200, marco restelli <mrestelli@...>:
              >>>> Hi all,
              >>>> this seems a simple question but I can not find any reference: is
              >>>> it possible to have a case insensitive comparison with vimdiff?
              >>>
              >>> OK, I think it is
              >>>
              >>> set diffopt+=icase
              >>
              >> Sorry for keeping replying to my own thread, but now there is another
              >> detail that I don't understand. Consider the following example, having
              >> set diffopt=filler,icase:
              >>
              >> 1) if I have two buffers with one line each:
              >> buffer 1 -> abc this IS a TEST
              >> buffer 2 -> this IS a TEST
              >>
              >> the characters abc in buffer 1 are highlighted (this is what I would
              >> expect)
              >>
              >> 2) same two buffers, with
              >> buffer 1 -> abc this IS a TEST
              >> buffer 2 -> this is a test
              >>
              >> now the complete lines are highlighted in both buffers, while I would
              >> like to have highlighted only abc, as in the first case.
              >>
              >> Is it possible to have 2) behave exactly like 1), highlighting only
              >> abs, regardless of the case of the remaining words?
              >
              > This is probably caused by the diff command detecting it as 1 deleted
              > line
              > and 1 added line instead of 1 changed line.
              >
              > I don't think, there is much Vim can do here.

              OK, thank you Christian, then I think the best solution is to copy the
              two files, pass both of them to lowercase with u in visual mode and
              use the standard diff.

              Marco

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/d/optout.
            • Christian Brabandt
              Hi marco! ... If you don t mind changing your buffer, create a custom filterwritepre command that filters your buffer through tr (works only on unix or within
              Message 6 of 7 , Jul 3, 2014
              • 0 Attachment
                Hi marco!

                On Do, 03 Jul 2014, marco restelli wrote:

                > 2014-07-03 11:40 GMT+0200, Christian Brabandt <cblists@...>:
                > > Am 2014-07-03 11:18, schrieb marco restelli:
                > >> 2014-07-03 11:08 GMT+0200, marco restelli <mrestelli@...>:
                > >>> 2014-07-03 10:58 GMT+0200, marco restelli <mrestelli@...>:
                > >>>> Hi all,
                > >>>> this seems a simple question but I can not find any reference: is
                > >>>> it possible to have a case insensitive comparison with vimdiff?
                > >>>
                > >>> OK, I think it is
                > >>>
                > >>> set diffopt+=icase
                > >>
                > >> Sorry for keeping replying to my own thread, but now there is another
                > >> detail that I don't understand. Consider the following example, having
                > >> set diffopt=filler,icase:
                > >>
                > >> 1) if I have two buffers with one line each:
                > >> buffer 1 -> abc this IS a TEST
                > >> buffer 2 -> this IS a TEST
                > >>
                > >> the characters abc in buffer 1 are highlighted (this is what I would
                > >> expect)
                > >>
                > >> 2) same two buffers, with
                > >> buffer 1 -> abc this IS a TEST
                > >> buffer 2 -> this is a test
                > >>
                > >> now the complete lines are highlighted in both buffers, while I would
                > >> like to have highlighted only abc, as in the first case.
                > >>
                > >> Is it possible to have 2) behave exactly like 1), highlighting only
                > >> abs, regardless of the case of the remaining words?
                > >
                > > This is probably caused by the diff command detecting it as 1 deleted
                > > line
                > > and 1 added line instead of 1 changed line.
                > >
                > > I don't think, there is much Vim can do here.
                >
                > OK, thank you Christian, then I think the best solution is to copy the
                > two files, pass both of them to lowercase with u in visual mode and
                > use the standard diff.

                If you don't mind changing your buffer, create a custom filterwritepre
                command that filters your buffer through tr (works only on unix or
                within a cygwin environment, e.g. something like this:

                fu! ConvertLower()
                %!tr "[A-Z]" "[a-z]"
                endfu

                aug MyDiff
                au!
                au FilterWritePre file* call ConvertLower()
                aug end

                Adjust the pattern file* to your filenames. If you are on windows,
                replace the tr part by
                :%s/.*/\L&/

                Best,
                Christian
                --
                Wir sind begieriger, fremde Menschen zu observieren und auszuspähen
                als tägliche und nahe.
                -- Jean Paul

                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/d/optout.
              • marco restelli
                ... Hi Christian, yes, this works, thanks! Marco -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text
                Message 7 of 7 , Jul 8, 2014
                • 0 Attachment
                  2014-07-03 21:05 GMT+0200, Christian Brabandt <cblists@...>:
                  > Hi marco!
                  >
                  > On Do, 03 Jul 2014, marco restelli wrote:
                  >
                  >> 2014-07-03 11:40 GMT+0200, Christian Brabandt <cblists@...>:
                  >> > Am 2014-07-03 11:18, schrieb marco restelli:
                  >> >> 2014-07-03 11:08 GMT+0200, marco restelli <mrestelli@...>:
                  >> >>> 2014-07-03 10:58 GMT+0200, marco restelli <mrestelli@...>:
                  >> >>>> Hi all,
                  >> >>>> this seems a simple question but I can not find any reference: is
                  >> >>>> it possible to have a case insensitive comparison with vimdiff?
                  >> >>>
                  >> >>> OK, I think it is
                  >> >>>
                  >> >>> set diffopt+=icase
                  >> >>
                  >> >> Sorry for keeping replying to my own thread, but now there is another
                  >> >> detail that I don't understand. Consider the following example, having
                  >> >> set diffopt=filler,icase:
                  >> >>
                  >> >> 1) if I have two buffers with one line each:
                  >> >> buffer 1 -> abc this IS a TEST
                  >> >> buffer 2 -> this IS a TEST
                  >> >>
                  >> >> the characters abc in buffer 1 are highlighted (this is what I would
                  >> >> expect)
                  >> >>
                  >> >> 2) same two buffers, with
                  >> >> buffer 1 -> abc this IS a TEST
                  >> >> buffer 2 -> this is a test
                  >> >>
                  >> >> now the complete lines are highlighted in both buffers, while I would
                  >> >> like to have highlighted only abc, as in the first case.
                  >> >>
                  >> >> Is it possible to have 2) behave exactly like 1), highlighting only
                  >> >> abs, regardless of the case of the remaining words?
                  >> >
                  >> > This is probably caused by the diff command detecting it as 1 deleted
                  >> > line
                  >> > and 1 added line instead of 1 changed line.
                  >> >
                  >> > I don't think, there is much Vim can do here.
                  >>
                  >> OK, thank you Christian, then I think the best solution is to copy the
                  >> two files, pass both of them to lowercase with u in visual mode and
                  >> use the standard diff.
                  >
                  > If you don't mind changing your buffer, create a custom filterwritepre
                  > command that filters your buffer through tr (works only on unix or
                  > within a cygwin environment, e.g. something like this:
                  >
                  > fu! ConvertLower()
                  > %!tr "[A-Z]" "[a-z]"
                  > endfu
                  >
                  > aug MyDiff
                  > au!
                  > au FilterWritePre file* call ConvertLower()
                  > aug end
                  >
                  > Adjust the pattern file* to your filenames. If you are on windows,
                  > replace the tr part by
                  > :%s/.*/\L&/

                  Hi Christian, yes, this works, thanks!

                  Marco

                  --
                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/d/optout.
                Your message has been successfully submitted and would be delivered to recipients shortly.