force vim background to black
Asked Answered
S

2

22

Is there any way, in my vimrc, to override the background setting of my colorscheme and force it to black? I'm looking for something like

set colorscheme=wombat256
override_background(black)

so that whatever scheme I select, the background gets forced to black.

Saccharine answered 30/9, 2011 at 21:29 Comment(2)
What if the foreground text in the theme is black as well?Prohibitory
then i'll get invisible text :) i mostly want this because there lots of themes that i like except for the grey/dark blue/otherwise off-black background, and it would be handy to not have to change them individually.Saccharine
A
31
 colorscheme wombat256
 highlight Normal guibg=black guifg=white
 set background=dark

Tweak to taste :)

@edit: after reading you later comment I suspect you'll find you need to override more related highlight (group) background colors. It'll be clearest which ones, by reading the existing color schemes

Ashely answered 30/9, 2011 at 21:35 Comment(2)
thanks :) that pointed me in the right direction. the actual command was highlight Normal ctermbg=None, thanks to a gnome terminal bug in which Black is not black [superuser.com/questions/142486/…Saccharine
I have to put set background=dark before the highlight override in order to make this work.Spinoza
L
7

This is what worked for me:

colorscheme wombat256
hi Normal ctermbg=16 guibg=#000000
hi LineNr ctermbg=16 guibg=#000000
Leung answered 29/3, 2020 at 15:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.