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

Re: Search And Yank

Expand Messages
  • Charles E. Campbell, Jr.
    As frequently happens, there s often multiple ways to do things in vim. Here s another: / / ey/ / (its a one liner, starting from normal mode)
    Message 1 of 14 , Feb 1, 2006
      As frequently happens, there's often multiple ways to do things in vim.
      Here's another:

      /\<this\>/"ey/\<find\>/

      (its a one liner, starting from normal mode)

      Regards,
      Chip Campbell
    • Charles E. Campbell, Jr.
      ... Whoops; please try / / ey/ zs/ instead (to get the find included). Regards, Chip Campbell
      Message 2 of 14 , Feb 1, 2006
        Charles E. Campbell, Jr. wrote:

        > As frequently happens, there's often multiple ways to do things in
        > vim. Here's another:
        >
        > /\<this\>/"ey/\<find\>/
        >
        > (its a one liner, starting from normal mode)
        >
        > Regards,
        > Chip Campbell
        >
        Whoops; please try

        /\<this\>/"ey/\<find\>\zs/

        instead (to get the "find" included).

        Regards,
        Chip Campbell
      • Tim Chase
        ... Or you can use the search modifiers / /e+ instead of the zs (one-third fewer characters, lower in trans-fats, and tastes great! :*) You ll also
        Message 3 of 14 , Feb 1, 2006
          > Whoops; please try
          >
          > /\<this\>/"ey/\<find\>\zs/
          >
          > instead (to get the "find" included).

          Or you can use the search modifiers

          /\<find\>/e+

          instead of the "\zs" (one-third fewer characters, lower in
          trans-fats, and tastes great! :*)

          You'll also want to hit <enter> after entering the search for
          /\<this\>/ (which can be done instead of the closing slash) which
          would make it

          /\<this\><cr>"ey/\<find\>/e+

          (where the <cr> is either literal in a mapping, or the actual
          <enter> key if typed live)

          -tim
        • Vigil
          ... Maybe I have some weird setting but none of those methods work. The immediate above one says the pattern is not found: E486: Pattern not found:
          Message 4 of 14 , Feb 2, 2006
            On Wed, 1 Feb 2006, Tim Chase wrote:

            >> /\<this\>/"ey/\<find\>\zs/
            >>
            >
            > /\<this\><cr>"ey/\<find\>/e+

            Maybe I have some weird setting but none of those methods work. The immediate
            above one says the pattern is not found:

            E486: Pattern not found: \<this\><cr>"ey

            --

            .
          • A. J. Mechelynck
            ... That s normal, input this way is interpreted as four characters, not one control code. Did you try my pattern? (all on one line) ... Best regards,
            Message 5 of 14 , Feb 2, 2006
              Vigil wrote:
              > On Wed, 1 Feb 2006, Tim Chase wrote:
              >
              >>> /\<this\>/"ey/\<find\>\zs/
              >>>
              >>
              >> /\<this\><cr>"ey/\<find\>/e+
              >
              > Maybe I have some weird setting but none of those methods work. The
              > immediate above one says the pattern is not found:
              >
              > E486: Pattern not found: \<this\><cr>"ey
              >

              That's normal, <cr> input this way is interpreted as four characters,
              not one control code. Did you try my pattern? (all on one line)

              :exe "normal \<Home>" . '/\<this\>' . "\r" . 'v/\<find\>' . "\r" . 'e"ey'


              Best regards,
              Tony.
            • Charles E. Campbell, Jr.
              ... Hmm, the was meant to be a carriage return, not the four characters . The / is intended to get your cursor on the word this .
              Message 6 of 14 , Feb 2, 2006
                Vigil wrote:

                > On Wed, 1 Feb 2006, Tim Chase wrote:
                >
                >>> /\<this\>/"ey/\<find\>\zs/
                >>>
                >>
                >> /\<this\><cr>"ey/\<find\>/e+
                >
                >
                > Maybe I have some weird setting but none of those methods work. The
                > immediate above one says the pattern is not found:
                >
                > E486: Pattern not found: \<this\><cr>"ey
                >
                Hmm, the <cr> was meant to be a carriage return, not the four characters
                < c r > .
                The /\<this\> is intended to get your cursor on the word "this".

                Regards,
                Chip Campbell
              • Vigil
                ... It is too long O:) -- .
                Message 7 of 14 , Feb 3, 2006
                  On Thu, 2 Feb 2006, A. J. Mechelynck wrote:

                  > That's normal, <cr> input this way is interpreted as four characters,
                  > not one control code. Did you try my pattern? (all on one line)
                  >
                  > :exe "normal \<Home>" . '/\<this\>' . "\r" . 'v/\<find\>' . "\r" . 'e"ey'

                  It is too long O:)

                  --

                  .
                Your message has been successfully submitted and would be delivered to recipients shortly.