I have a .gvimrc file that works fine on OS X 10.6, but won't work on Ubuntu. It contains a line that reads set transparency=15, and when i run gVim it reports:

Error detected while processing /home/user/.gvimrc: 
line   25: 
E518: Unknown option: transparency=15

Any ideas to make gVim transparent by default?


The whole .gvimrc file for completion:

" Turn on line numbers
set number

" Change colorscheme
colorscheme ir_black

" Turns on the tab bar always
set showtabline=2

" Number of horizontal lines on the screen
set lines=60

" GUI Option to remove the Toolbar (T)
set guioptions-=T

" Sets the percent transparency
set transparency=15

I'm afraid the transparency feature is only in MacVim. I just grepped the source code for Vim 7.3 (the latest stable version) and I couldn't find any trace of a transparency option.

One possible solution is to do it via Compiz; look for the module that enables transparent windows: from there you should be able to set up a special rule for Gvim windows.

| improve this answer | |

Another option would be to skip gvim and just run regular vim inside, e.g., gnome-terminal or some other terminal emulator that supports transparency. (I use guake.) Gvim doesn't offer much over regular vim.

| improve this answer | |
sudo apt-get install  xcompmgr devilspie transset-df
mkdir -p ~/.devilspie
cd ~/.devilspie
touch opacity.ds
vim opacitiy.ds

Change the file contents to:

( if ( contains ( window_class ) "Gvim" ) ( begin ( spawn_async (str
"transset-df -i " (window_xid) " 0.85" )) ) )

You may add devilspie /home/username/.devilspie/opacity in startup apps.

| improve this answer | |
  • On later versions of ubuntu, replace transset-df with x11-apps. Then in the opacity.ds file, change it to: transset (remove the -df) – matiu Apr 24 '13 at 5:13

Inside your .gvimrc
autocmd GuiEnter * silent exec "!transset -a 0.80"

Possible variants: transset might be transset-df, 0.80 is the opacity (from 0 - 1).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.