Tuesday, August 7, 2012

Re: Activating gVim from the command line (cont)

On Tuesday, August 7, 2012 5:35:18 AM UTC-5, Christian Brabandt wrote:
> Hi His!
>
>
>
> On Mo, 06 Aug 2012, His Nerdship wrote:
>
>
>
> > On Aug 6, 6:08 am, Christian Brabandt <cbli...@256bit.org> wrote:
>
> > > Hi His!
>
> > >
>
> > >
>
> > > Try separating the command range by ',' instead of ';'
>
> > >
>
> > > See :h :;
>
> > >
>
> > > regards,
>
> > > Christian- Hide quoted text -
>
> > >
>
> > > - Show quoted text -
>
> >
>
> > Thanks Christian. I take it you mean this:
>
> >
>
> > gvim --servername HgVim --remote-silent "+51,/blobfish/;:call
>
> > search('blobfish','c')" fish.cpp
>
> >
>
> > i.e a comma after the +51?
>
>
>
> Actually, I meant something like this:
>
> gvim --servername HgVim --remote-silent "+51,/blobfish/call
>
> search('blobfish','c')" fish.cpp
>
>
>
> But you could probably remove the range argument and add the /\%51l item
>
> to your regular expression, e.g.
>
>
>
> gvim --servername HgVim --remote-silent "+call
>
> search('\%51lblobfish','c')" fish.cpp
>
>
>
>
>
> regards,
>
> Christian

From previous discussion, he claims to want the first "blobfish" on or after line 51. While this could be done with the line number match, it seemed clearer to use a range.

But maybe try the line number match anyway, the pattern should be like '\%51l\_.\{-}\zsblobfish' (untested), which should match any number of characters including line endings on or after line 51, as few as possible until "blobfish" is encountered, and set the start of match to the start of "blobfish".

--
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

No comments: