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

Re: search with offset

Expand Messages
  • Marcin Szamotulski
    ... Thank you both Tim and Shlomi, I tested this with vim -u NONE --noplugin so I will report it on vim_dev. I will try to use your maps. They also have the
    Message 1 of 5 , Jun 1, 2013
    • 0 Attachment
      On 07:46 Sat 01 Jun , Tim Chase wrote:
      > On 2013-06-01 11:40, Marcin Szamotulski wrote:
      > > Do you know how to repeat vim search preserving the offset. For
      > > example /hello/;?Mark?
      > > the n and N commands seems to forget about the offset, well actually
      > > they forget about the patter and remember only the offset.
      >
      > This is strange, as n/N remember the other {offset} modifiers:
      >
      > /thing/e
      > n
      >
      > goes to the end of the next "thing" match. I'd consider classifying
      > this as a bug: either in behavior, or in (lack of)
      > clarification in the documentation.
      >
      > > I have found that vim remembers the whole search
      > > pattern+offset in the search history (:h :histget()).
      >
      > With this information, you could do something like
      >
      > :nnoremap n /<up><cr>
      >
      > to get "n" behavior, but it gets tricky when you want to reverse it
      > (you'd have to swap the "/" for "?" in the "right" placs, and define
      > whether you want to search backwards for pattern#1, then forwards
      > for pattern#2 (what I suspect you want), or backwards for pattern#1
      > and then backwards further for pattern#2.
      >
      > -tim
      >

      Thank you both Tim and Shlomi,

      I tested this with vim -u NONE --noplugin so I will report it on
      vim_dev. I will try to use your maps. They also have the additional
      feature that they do not change the direction of searches. Let me see
      if I can forget the vim defaults :D

      Best regards,
      Marcin

      --
      --
      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/groups/opt_out.
    • Yann Thomas-GĂ©rard
      ... IMHO, it needs documentation clarification. See :h last-pattern The last used pattern and offset are remembered. This excludes the very special offset
      Message 2 of 5 , Jun 3, 2013
      • 0 Attachment
        > This is strange, as n/N remember the other {offset} modifiers:
        >
        >
        >
        > /thing/e
        >
        > n
        >
        >
        >
        > goes to the end of the next "thing" match. I'd consider classifying
        >
        > this as a bug: either in behavior, or in (lack of)
        >
        > clarification in the documentation.

        IMHO, it needs documentation clarification. See :h last-pattern

        "The last used pattern and offset are remembered."

        This excludes the very special offset ";". So in:

        /foo/e;/bar/e

        /bar/e

        only will be remembered.

        --
        --
        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/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.