Thursday, May 14, 2015

Re: Set highlight colours according to screen

On 2015-05-15, Paul wrote:
> Paul <Paul.Domaskis <at> gmail.com> writes:
> > The application of the color scheme file seems to be triggered by
> > many things. So it looks like the best implementation of the
> > solution is for the colour scheme file to contain an "if" statement
> > that sets colours according to a global flag. You manully set the
> > global flag depending on whether you're using an external monitor or
> > the native screen.
>
> Wow, google is great. For completeness, here is what I have at the
> *end* of my colorscheme file:
>
> if exists('g:lapscreen') "Compensate for yucky native laptop screen
> hi Normal guibg=#000050
> hi CursorLine guibg=#004000
> hi CursorColumn guibg=#004000 guifg=gray80
> endif
>
> If you're on a yucky laptop screen, type :let lapscreen='' followed by
> ":colorscheme myColorScheme" without the quotes. If you subsequently
> switch to a nice external monitor, type ":unlet lapscreen" without the
> quotes, followed by ":colorscheme myColorScheme" without the quotes.
> Note that for each highlight command in the if-block, you should have
> a default corresponding command above the if-block for the case that
> g:lapscreen is unset.

You wrote earlier:
> In my case, it's not really a screen extenxtion situation. I'm
> either in the office, in which case I dock the machine and use the
> big screen, or I am away from my desk, in which case I rely on the
> native low-contrast screen.

You should be able to find something in your environment that tells
you whether you're at or away from your desk, such as your IP
address, or whether you're using your Ethernet or wireless
interface. Then you could use that information to set g:lapscreen
automatically.

Regards,
Gary

--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment