Le jeudi 26 février 2015 à 04:57, Ni Va a écrit:
> On Thursday, February 26, 2015 at 4:31:40 PM UTC+1, Gary Johnson wrote:
> > On 2015-02-26, Ni Va wrote:
> > > Hi,
> > >
> > > I would like to define a region based on current page displayed of
> > > opened buffer.
> > >
> > > How can I define that ?
> >
> > I don't know what you mean by "define a region", but you can
> > visually select all the lines on the current displayed page with
> >
> > HVL
> >
> > H moves the cursor to the first line of the window; V starts
> > visual mode linewise; L moves the cursor to the last line of the
> > window.
> >
> > Regards,
> > Gary
>
> Hi Gary,
>
> I know visual selection but I just want to define a region to set this command line :
>
> syntax sync region ... in order to do syn only on current displayed page
See ":help \%l" and ":help line()" (especially with "w0" and "w$") and
you should be able to do something like:
exec 'syntax region YourRegion start=+\\%' . line('w0') . 'l+ end=+\\%' . line('w$') . 'l+'
Best,
Paul
--
--
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.
For more options, visit https://groups.google.com/d/optout.
Thursday, February 26, 2015
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment