highlight whole line, from column 1 to end of screen, EVEN if text is short

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

highlight whole line, from column 1 to end of screen, EVEN if text is short

iler.ml

I am highlighting certain line using :match  IncSearch /\%123l/
(matchadd() actually).
The problem is that I want thr whole line highlighted, even if text is
short.
Highlight to the width of window, not only the width of text.
How can I do it.

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

Reply | Threaded
Open this post in threaded view
|

Re: highlight whole line, from column 1 to end of screen, EVEN if text is short

Benjamin Fritz



On Apr 4, 2:28 pm, Yakov <[hidden email]> wrote:
> I am highlighting certain line using :match  IncSearch /\%123l/
> (matchadd() actually).
> The problem is that I want thr whole line highlighted, even if text is
> short.
> Highlight to the width of window, not only the width of text.
> How can I do it.

I'm pretty sure you can't.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: highlight whole line, from column 1 to end of screen, EVEN if text is short

Erik Falor
In reply to this post by iler.ml

On Sat, Apr 04, 2009 at 12:28:46PM -0700, Yakov wrote:
>
> I am highlighting certain line using :match  IncSearch /\%123l/
> (matchadd() actually).
> The problem is that I want thr whole line highlighted, even if text is
> short.
> Highlight to the width of window, not only the width of text.
> How can I do it.
>

It is possible to highlight an entire line using the :sign mechanism.

An example can be found at :help sign-commands

In a nutshell:

:sign define wholeline linehl=ErrorMsg
:sign place 1 name=wholeline line=123 file=thisfile.txt

Obviously, you should pick a higlight group that changes the color of the
background for the linehl argument.

The chief drawback to this approach is that the signcolumn will be
displayed, taking up two columns on the left-hand side of the buffer.

--
Erik Falor
Registered Linux User #445632 http://counter.li.org

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