Skip to main content
deleted 19 characters in body; edited title
Source Link
Vivian De Smedt
  • 21k
  • 5
  • 22
  • 40

how How can I condition a variable on my colorscheme?

I use different colorschemescolorschemes depending on the color of my xterm. SomeSome of them (in particular torte) set the background color to black, others leave the background color the same as the xterm color. The colorscheme is specified as an environment variable for each xterm.

I also use the lines:

set hlsearch
hi Search ctermfg=white  ctermbg=black cterm=NONE
hi IncSearch ctermfg=Black  ctermbg=lightyellow cterm=bold,underline,reverse

which highlight with a black background my search term. Obviously this doesn't help me when the background is already black. SoSo I'd like to condition the above lines (specifically ctermfg) on the value of the environment variable which specifies my color schemecolorscheme. (Specificallyspecifically, whether this value is torte) ShouldShould be easy but I'm hopeless with vimVim syntax. Thanks!

how can I condition a variable on my colorscheme?

I use different colorschemes depending on the color of my xterm. Some of them (in particular torte) set the background color to black, others leave the background color the same as the xterm color. The colorscheme is specified as an environment variable for each xterm.

I also use the lines

set hlsearch
hi Search ctermfg=white  ctermbg=black cterm=NONE
hi IncSearch ctermfg=Black  ctermbg=lightyellow cterm=bold,underline,reverse

which highlight with a black background my search term. Obviously this doesn't help me when the background is already black. So I'd like to condition the above lines (specifically ctermfg) on the value of the environment variable which specifies my color scheme. (Specifically, whether this value is torte) Should be easy but I'm hopeless with vim syntax. Thanks!

How can I condition a variable on my colorscheme?

I use different colorschemes depending on the color of my xterm. Some of them (in particular torte) set the background color to black, others leave the background color the same as the xterm color. The colorscheme is specified as an environment variable for each xterm.

I also use the lines:

set hlsearch
hi Search ctermfg=white  ctermbg=black cterm=NONE
hi IncSearch ctermfg=Black  ctermbg=lightyellow cterm=bold,underline,reverse

which highlight with a black background my search term. Obviously this doesn't help me when the background is already black. So I'd like to condition the above lines (specifically ctermfg) on the value of the environment variable which specifies my colorscheme. (specifically, whether this value is torte) Should be easy but I'm hopeless with Vim syntax.

edited tags
Link
Martin Tournoij
  • 63.3k
  • 26
  • 199
  • 274
Source Link
Leo Simon
  • 725
  • 1
  • 5
  • 12

how can I condition a variable on my colorscheme?

I use different colorschemes depending on the color of my xterm. Some of them (in particular torte) set the background color to black, others leave the background color the same as the xterm color. The colorscheme is specified as an environment variable for each xterm.

I also use the lines

set hlsearch
hi Search ctermfg=white  ctermbg=black cterm=NONE
hi IncSearch ctermfg=Black  ctermbg=lightyellow cterm=bold,underline,reverse

which highlight with a black background my search term. Obviously this doesn't help me when the background is already black. So I'd like to condition the above lines (specifically ctermfg) on the value of the environment variable which specifies my color scheme. (Specifically, whether this value is torte) Should be easy but I'm hopeless with vim syntax. Thanks!