On Sat, Feb 28, 2009 at 3:28 AM, Sean <[email protected]> wrote:
> ------------------------
> idle -- line 1
> idle -- line 2
> if   -- line 3
> if   -- line 4
> if   -- line 5
> iff  -- line 6
> ill  -- line 7
> ------------------------
>
> What I want is two numbers with the pattern starting with "if":
> (1) find the start line, 3 in this example
> (2) find the end line, 5 in this example

Another possible lead (as to other proposed ones) is to do a multiline
search and put temporary markers for the beginning and end line
which you can later process for getting the line numbers:

%s/\(^if .*\n\)\+/\='BEGIN'.submatch(0).'END'/

nazri.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to