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

color the active line

Expand Messages
  • rehm.armin@schwenk.de
    Hello, is it possible in vim to color the active line, I mean the line in which the cursor is. Can you give me a hint on how to realize it? I found it nice to
    Message 1 of 6 , Jun 1, 2002
    • 0 Attachment
      Hello,

      is it possible in vim to color the active line,
      I mean the line in which the cursor is.

      Can you give me a hint on how to realize it?

      I found it nice to see the active line in a different color from the other
      text.
      It helps me a lot in reading a file.

      Thanks,
      Armin

      Email: rehm.armin@...
    • Benji Fisher
      ... Not entirely satisfactory, but read ... HTH --Benji Fisher
      Message 2 of 6 , Jun 2, 2002
      • 0 Attachment
        rehm.armin@... wrote:
        >
        > Hello,
        >
        > is it possible in vim to color the active line,
        > I mean the line in which the cursor is.
        >
        > Can you give me a hint on how to realize it?
        >
        > I found it nice to see the active line in a different color from the other
        > text.
        > It helps me a lot in reading a file.

        Not entirely satisfactory, but read

        :help /\%l

        HTH --Benji Fisher
      • Benji Fisher
        ... HTH --Benji Fisher
        Message 3 of 6 , Jun 2, 2002
        • 0 Attachment
          Benji Fisher wrote:
          >
          > rehm.armin@... wrote:
          > >
          > > Hello,
          > >
          > > is it possible in vim to color the active line,
          > > I mean the line in which the cursor is.
          > >
          > > Can you give me a hint on how to realize it?
          > >
          > > I found it nice to see the active line in a different color from the other
          > > text.
          > > It helps me a lot in reading a file.
          >
          > Not entirely satisfactory, but read
          >
          > :help /\%l

          You might like this:

          :au! CursorHold * let @/ = '\%' . line('.') . 'l.*'
          :set ut=500

          HTH --Benji Fisher
        • Steve Hall
          From: Benji Fisher ... other ... Wow, *I* like it! But I m not sure of exactly what s happening here... how can I make this work from
          Message 4 of 6 , Jun 2, 2002
          • 0 Attachment
            From: "Benji Fisher" <benji@...>
            >
            > Benji Fisher wrote:
            > >
            > > rehm.armin@... wrote:
            > > >
            > > > Hello,
            > > >
            > > > is it possible in vim to color the active line,
            > > > I mean the line in which the cursor is.
            > > >
            > > > Can you give me a hint on how to realize it?
            > > >
            > > > I found it nice to see the active line in a different color from the
            other
            > > > text.
            > > > It helps me a lot in reading a file.
            > >
            > > Not entirely satisfactory, but read
            > >
            > > :help /\%l
            >
            > 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?


            Steve Hall [ digitect@... ]
            --
            Try Cream in your Vim... it takes the bitterness out!
            http://cream.sourceforge.net
          • 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 5 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 6 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.