the idea is not to move the cursor. :$ moves it to the end of file. does anybody have any other suggestions. also please click 'Reply to author' so i could get notified.
thanks On May 5, 11:01 am, "Christian Brabandt" <[email protected]> wrote: > On Thu, May 5, 2011 4:55 pm, cyboman wrote: > > i'm writing a script to modify the copyright notice. the problem is > > that are multiple notices in the file. i need to be able to find a > > line where the last notice occurs. vim search() function finds only > > the first pattern occurrence. does anybody know of a way to find the > > last pattern occurrence? > > > here is the example: > > > copyright 2008, company a > > copyright 2009, company b > > copyright 2010, company c > > copyright 2011, company d > > > i need to be able to find the last occurrence of the following pattern > > copyright \d\{4}. > > Jumping to the last line and searching backwards should work: > :$ > :echo search('copyright \d\{4}', 'bnW') > > regards, > Christian -- 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
