Loading ...
Sorry, an error occurred while loading the content.

Re: color the active line

Expand Messages
  • Benji Fisher
    ... [snip] ... What it does: after 500 ms of waiting for you to hit a key, vim executes ... and this sets the search register to a pattern that matches the
    Message 1 of 6 , Jun 2, 2002
    • 0 Attachment
      Steve Hall wrote:
      >
      > From: "Benji Fisher" <benji@...>
      > >
      [snip]
      > > You might like this:
      > >
      > > :au! CursorHold * let @/ = '\%' . line('.') . 'l.*'
      > > :set ut=500
      >
      > Wow, *I* like it! But I'm not sure of exactly what's happening here... how
      > can I make this work from insertmode?

      What it does: after 500 ms of waiting for you to hit a key, vim executes

      :let @/ = '\%' . line('.') . 'l.*'

      and this sets the search register to a pattern that matches the current line.
      AFAICT, the docs do not mention it, but the CursorHold event seems to be
      triggered only in Normal mode, but not in Insert mode, so I do not see how to
      do it with 'insertmode' set.

      :help CursorHold
      :help 'ut'
      :help /\%l
      :help "/

      HTH --Benji Fisher
    • Steve Hall
      From: Benji Fisher ... Ugh, just what I ve been experiencing. Thanks for the insight though. Steve Hall [ digitect@mindspring.com ]
      Message 2 of 6 , Jun 2, 2002
      • 0 Attachment
        From: "Benji Fisher" <benji@...>
        >
        > Steve Hall wrote:
        > >
        > > From: "Benji Fisher" <benji@...>
        > > >
        > > > You might like this:
        > > >
        > > > :au! CursorHold * let @/ = '\%' . line('.') . 'l.*'
        > > > :set ut=500
        > >
        > > Wow, *I* like it! But I'm not sure of exactly what's happening
        > > here... how can I make this work from insertmode?
        >
        > [snip]
        >
        > AFAICT, the docs do not mention it, but the CursorHold event seems
        > to be triggered only in Normal mode, but not in Insert mode, so I do
        > not see how to do it with 'insertmode' set.
        >
        > :help CursorHold
        > :help 'ut'
        > :help /\%l
        > :help "/

        Ugh, just what I've been experiencing. Thanks for the insight though.


        Steve Hall [ digitect@... ]
      Your message has been successfully submitted and would be delivered to recipients shortly.