On Tue, Jun 17, 2008 at 6:43 PM, Tony Mechelynck <
[EMAIL PROTECTED]> wrote:

>
> On 17/06/08 16:40, Yakov Lerner wrote:
> > We do not have autocommand that fires when option is set/changed, right ?
> > vim 8 maybe ? Can this be added to do todo ?
> >
> > For example, when I do 'set tw=70' I want automatically
> > execute "match Error /\%>70v/".
> >
> > I realize I can make a custom command or function to
> > change two things together. But if this was a good method, then vim
> > never had autocommands in the first place.
> >
> > Yakov
>
> You can define an autocommand on some other event(s) (CursorMoved and
> CursorMovedI, maybe) to highlight whatever gets after the 'textwidth'.
> Here's an example:
>
>        :au CursorMoved  * exe 'match Error /\%>' . &tw . 'v/'
>        :au CursorMovedI * exe 'match Error /\%>' . &tw . 'v/'
>
> These events are already used by the matchparen.vim plugin, so you're in
> good company.
>
>
I am thinking about making use of CursorHold/CursorHoldI event. Remeber old
option value, compare it to the current value, detect option change,
handle. I have very low 'updatetime'  value anyway (200 milli).

Yakov

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

Raspunde prin e-mail lui