11

Is there a way to have a transparent Vim session within the xfce-4 terminal?

tmaric
  • 385
  • 1
  • 4
  • 14

2 Answers2

23

I made mine transparent in gnome-terminal (and I'm guessing this will work for xfce-4 too)

I'm using Molokai theme (the 256 colour version).

I just had to change one line.

(original):

hi Normal          ctermfg=252 ctermbg=233

(my version, with transparent background):

hi Normal          ctermfg=252 ctermbg=none
Diogo
  • 30,192
  • 65
  • 150
  • 222
Juanjo
  • 346
  • 1
  • 2
  • 1
    Juanjo's answer is great, and inspired me to add this edit: `hi NonText ctermfg=250 ctermbg=none` This ensures that the parts of buffers that don't have content, are transparent. – duma Dec 23 '12 at 20:20
  • 6
    Note that you can just add this line to your `.vimrc` and it will have the same effect: `hi Normal guibg=NONE ctermbg=NONE`. And it won't change the forgroud color for the `Normal` group either. – Robert Audi Feb 09 '14 at 21:19
2

In the Terminal Preferences dialog, the Appearance tab has a "Transparent background" option to make the window transparent. If you found this option and set it appropriately, I can think of two reasons that it might not be working for you:

1) You might be using gvim instead of console vim within the terminal. If Vim opens up a new window, then you're using gvim instead of console vim.

2) You might have a vim colorscheme that explicitly sets white or black as the background color. It's unusual to have a misbehaving color scheme like this, so I don't think it's likely.

I think it's most likely that you're actually using gvim instead of console vim.

amcnabb
  • 353
  • 1
  • 7
  • Thanks for the answer, but I've figured it out: the vim coloscheme had ctermbg set to "black", I've removed it and now the background is transparent. I'm definitely using vim. – tmaric Mar 08 '12 at 09:47
  • So my answer was right, then, wasn't it? I suggested it might be a colorscheme that explicitly sets the background to black or white, which indeed turned out to be the problem. – amcnabb Mar 13 '12 at 18:14
  • sorry for accepting your answer so late.. it missed my attention somehow.. – tmaric Jan 21 '13 at 13:05