Friday, January 13, 2023

Re: Searching across a range of lines

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





--
--
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@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/Y8IBig8i30NxtWYm%40thechases.com.

No comments: