syntax highlighting for empty lines

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

syntax highlighting for empty lines

ericmsmith
Hi

How do I highlight a line with no characters (except of source a
newline one)?

The effect I want is a solid background line to divide
paragraphs.
 
--
Eric Smith

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting for empty lines

Jacky Alciné
Is there a particular filetype you want to do this for?

And why not use list mode?

On Sat, Nov 15, 2014 at 2:46 PM, Eric Smith <[hidden email]> wrote:

> Hi
>
> How do I highlight a line with no characters (except of source a
> newline one)?
>
> The effect I want is a solid background line to divide
> paragraphs.
>
> --
> Eric Smith
>
> --
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.



--
Jacky Alciné - http://jalcine.me

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting for empty lines

ericmsmith

Jacky Alciné wrote on Sat-15-Nov 14  8:56PM
> Is there a particular filetype you want to do this for?
>
> And why not use list mode?

Thanks Jacky.

Filetype requirement is not important.

List mode does not look pretty to me like the solution I described.
The effect is intended not for programming but for readability of my data files that
are new line delimited.

Eric

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting for empty lines

Jacky Alciné

The effect is for programming, it's meant to not be intrustive and be more of an auxiliary kind of thing. With good syntax highlighting and a good color scheme, it's the best.

- Jacky Alciné
Sent from my phone; sans the mistakes.

On Nov 15, 2014 1:00 PM, "Eric Smith" <[hidden email]> wrote:

Jacky Alciné wrote on Sat-15-Nov 14  8:56PM
> Is there a particular filetype you want to do this for?
>
> And why not use list mode?

Thanks Jacky.

Filetype requirement is not important.

List mode does not look pretty to me like the solution I described.
The effect is intended not for programming but for readability of my data files that
are new line delimited.

Eric

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting for empty lines

Benjamin Fritz
On Saturday, November 15, 2014 4:15:32 PM UTC-6, Jacky Alciné wrote:
> The effect is for programming, it's meant to not be intrustive and be more of an auxiliary kind of thing. With good syntax highlighting and a good color scheme, it's the best.
>

The OP wants a solid background color line if the line is empty.

You cannot possibly achieve this with list mode.

The only way to highlight an entire empty line, is to place a sign defined with linehl used to define a background color.

This sign will move around as the line moves around (good) but you must place it manually or write your own script to do it on cursorhold or something. It's possible there is an existing plugin but I don't know of one.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting for empty lines

Christian Brabandt
On Mo, 17 Nov 2014, Ben Fritz wrote:

> On Saturday, November 15, 2014 4:15:32 PM UTC-6, Jacky Alciné wrote:
> > The effect is for programming, it's meant to not be intrustive and be more of an auxiliary kind of thing. With good syntax highlighting and a good color scheme, it's the best.
> >
>
> The OP wants a solid background color line if the line is empty.
>
> You cannot possibly achieve this with list mode.
>
> The only way to highlight an entire empty line, is to place a sign defined with linehl used to define a background color.
>
> This sign will move around as the line moves around (good) but you must place it manually or write your own script to do it on cursorhold or something. It's possible there is an existing plugin but I don't know of one.

My DynamicSigns plugin (https://github.com/chrisbra/DynamicSigns) can do
this:

:SignExpression getline(v:lnum)!~#'.'?'Line':0

(which means, use the 'Line' sign for highlighting empty lines.)

Best,
Christian
--
Wenn wir unseren Leidenschaften widerstehen, danken wir es mehr ihrer
Schwäche als unserer Stärke.
                -- François Duc de La Rochefoucauld

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.