On Fri, Jan 13, 2023 at 8:13 PM Tim Chase <[email protected]> wrote:

> On 2023-01-13 16:41, Salman Halim wrote:
> > For example, I want to find a match for 'cat', but only in lines 50 to
> > 100. If my cursor is before line 50 when I start, I can prefix my
> > expression with \%>49 and pass 100 as the stopline, but that doesn't
> > work if my cursor is AFTER line 50 as it starts the match at the cursor
> > location.
> > I don't want to first move my cursor.
>
> While possibly not quite what you're looking for, if I want such, I use
>
>   :50,100g/cat
>
> or, if I want to know which line-numberss:
>
>   :50,100g/cat/#
>
>
> -tim
>

Tim, this doesn't do what I'm trying to do, but the bigger problem is that
:g absolutely moves the cursor, putting it on the last found match.

Thanks very much,

Salman

-- 
-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CANuxnEcXzUyY%3Db8bEofU1yKQHWqbsOjmCrSKnApc57C9H%3DK3Gg%40mail.gmail.com.

Reply via email to