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

Re: stay where you after a global search

Expand Messages
  • Preben Guldberg
    ... I think you need to end the pattern with a / (since you started with a /). Furthermore, you cannot use ` to position by column as an ex command, so you
    Message 1 of 2 , Jun 1, 2001
    • 0 Attachment
      Thus wrote Eric Smith (eric@...) on [010601]:
      > most times when I do a global search i want the cursor to retain its
      > current position, so I tried the following to return to the last
      > position:
      > :g/pattern\| `'
      > and it does not do what is required.

      I think you need to end the pattern with a / (since you started with a
      /).

      Furthermore, you cannot use "`" to position by column as an ex
      command, so you probably need

      :g/pattern/|norm `'

      Not though, that

      :g/pattern/#

      and

      :il /pattern/

      do pretty much the same, except that :il does not move the cursor.
      There are differences though, so try it out for size.

      Peppe
      --
      "Before you criticize someone, walk
      Preben "Peppe" Guldberg __/-\__ a mile in his shoes. That way, if
      c928400@... (o o) he gets angry, he'll be a mile away
      ----------------------oOOo (_) oOOo-- - and barefoot." --Sarah Jackson
    Your message has been successfully submitted and would be delivered to recipients shortly.