Spacevim: Can't get a transparent background

Created on 14 Mar 2018  路  2Comments  路  Source: SpaceVim/SpaceVim

Expected behavior, english is required

I wanted to have my background transparent so I added up those two lines in my .SpaceVim.d/init.vim file:

highlight Normal guibg=NONE ctermbg=NONE
highlight NonText guibg=NONE ctermbg=NONE

after adding those two lines, and sourcing the file with :source % it makes the background transparent (though only in areas with text).
BUT, the background isn't transparent when I reopen the file or open another file.

I guess the theme is loaded after my two lines are read.

usage

Most helpful comment

you can use autocmd for this kind of command, highlight will be cleared when you switch colorscheme.

so you can use something like this

func! s:transparent_background()
    highlight Normal guibg=NONE ctermbg=NONE
    highlight NonText guibg=NONE ctermbg=NONE
endf
autocmd ColorScheme * call s:transparent_background()

All 2 comments

you can use autocmd for this kind of command, highlight will be cleared when you switch colorscheme.

so you can use something like this

func! s:transparent_background()
    highlight Normal guibg=NONE ctermbg=NONE
    highlight NonText guibg=NONE ctermbg=NONE
endf
autocmd ColorScheme * call s:transparent_background()

It is an old closed post. It is worth mentioning that for spacevim 1.6.0 as of now, we need the following configurations to get a transparent background.

highlight Normal guibg=NONE ctermbg=NONE
highlight NonText guibg=NONE ctermbg=NONE
highlight EndOfBuffer guibg=NONE ctermbg=NONE
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lobosque picture Lobosque  路  3Comments

wsdjeg picture wsdjeg  路  3Comments

wsdjeg picture wsdjeg  路  3Comments

s97712 picture s97712  路  4Comments

wsdjeg picture wsdjeg  路  4Comments