Transparent background for Windows version of gvim

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Transparent background for Windows version of gvim

Woody Wu

Hi,

I've been using gvim in Windows.  I am just wondering if there is a
solution that can make my gvim transparent to my desktop background or
simply have a background picture.  We get this feature when we are
using rxvt in Linux.  I hope I can still have the similar function in
Windows + Gvim.

Thanks in advance.

--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Transparent background for Windows version of gvim

Christian Brabandt

On Tue, October 20, 2009 2:06 pm, Steven Woody wrote:
> I've been using gvim in Windows.  I am just wondering if there is a
> solution that can make my gvim transparent to my desktop background or
> simply have a background picture.  We get this feature when we are
> using rxvt in Linux.  I hope I can still have the similar function in
> Windows + Gvim.

Using VimTweak¹ you can. I have something like this in my .vimrc:

func! ToggleDarkroom()
" You need the darkroom colorscheme from
http://www.vim.org/scripts/script.php?script_id=2246
" and you need vimtweak.dll from
http://www.vim.org/scripts/script.php?script_id=687
    if !exists("g:darkroom")
        let g:darkroom=1
        let s:o_lbr=&lbr
        let s:o_wrap=&wrap
        let s:o_colors = exists("g:colors_name") ? g:colors_name : "default"
    else
        let g:darkroom = 1 - g:darkroom
    endif
    if (g:darkroom)
        let &go=""
        set lbr wrap stal&
        call libcallnr("vimtweak.dll", "SetAlpha", 210)
        call libcallnr("vimtweak.dll", "EnableMaximize", 1)
        call libcallnr("vimtweak.dll", "EnableCaption", 0)
        call libcallnr("vimtweak.dll", "EnableTopMost", 1)
        colorscheme darkroom
    else
        let &lbr=s:o_lbr
        let &wrap=s:o_wrap
        exe "colorscheme ".s:o_colors
        set go& stal&
        call libcallnr("vimtweak.dll", "SetAlpha", 255)
        call libcallnr("vimtweak.dll", "EnableMaximize", 0)
        call libcallnr("vimtweak.dll", "EnableCaption", 1)
        call libcallnr("vimtweak.dll", "EnableTopMost", 0)
    endif
endfu

nmap <F11> :call  ToggleDarkroom()<CR>

I think someone posted this or a slightly similar version to this list.

Another approach would be to use the rxvt from the Cygwin package, which
can be switched to a transparent mode, IIRC. I used to do this, until I
started using Gvim in Windows, which is a more comfortable.


¹)http://www.vim.org/scripts/script.php?script_id=687

regards,
Christian
--
:wq


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Transparent background for Windows version of gvim

Woody Wu

On Tue, Oct 20, 2009 at 10:16 PM, Christian Brabandt <[hidden email]> wrote:

>
> On Tue, October 20, 2009 2:06 pm, Steven Woody wrote:
>> I've been using gvim in Windows.  I am just wondering if there is a
>> solution that can make my gvim transparent to my desktop background or
>> simply have a background picture.  We get this feature when we are
>> using rxvt in Linux.  I hope I can still have the similar function in
>> Windows + Gvim.
>
> Using VimTweak¹ you can. I have something like this in my .vimrc:
>
> func! ToggleDarkroom()
> " You need the darkroom colorscheme from
> http://www.vim.org/scripts/script.php?script_id=2246

I hesitate to use the colorscheme because it claims that I have to use
':qa' to quit the gvim.

> " and you need vimtweak.dll from
> http://www.vim.org/scripts/script.php?script_id=687
>    if !exists("g:darkroom")
>        let g:darkroom=1
>        let s:o_lbr=&lbr
>        let s:o_wrap=&wrap
>        let s:o_colors = exists("g:colors_name") ? g:colors_name : "default"
>    else
>        let g:darkroom = 1 - g:darkroom
>    endif
>    if (g:darkroom)
>        let &go=""
>        set lbr wrap stal&
>        call libcallnr("vimtweak.dll", "SetAlpha", 210)
>        call libcallnr("vimtweak.dll", "EnableMaximize", 1)
>        call libcallnr("vimtweak.dll", "EnableCaption", 0)
>        call libcallnr("vimtweak.dll", "EnableTopMost", 1)
>        colorscheme darkroom
>    else
>        let &lbr=s:o_lbr
>        let &wrap=s:o_wrap
>        exe "colorscheme ".s:o_colors
>        set go& stal&
>        call libcallnr("vimtweak.dll", "SetAlpha", 255)
>        call libcallnr("vimtweak.dll", "EnableMaximize", 0)
>        call libcallnr("vimtweak.dll", "EnableCaption", 1)
>        call libcallnr("vimtweak.dll", "EnableTopMost", 0)
>    endif
> endfu
>
> nmap <F11> :call  ToggleDarkroom()<CR>
>
> I think someone posted this or a slightly similar version to this list.
>
> Another approach would be to use the rxvt from the Cygwin package, which
> can be switched to a transparent mode, IIRC. I used to do this, until I
> started using Gvim in Windows, which is a more comfortable.
>
>
> ¹)http://www.vim.org/scripts/script.php?script_id=687
>
> regards,
> Christian
> --
> :wq
>
>
> >
>



--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Transparent background for Windows version of gvim

Bugzilla from mortgat@gmail.com


On Tue, Oct 20, 2009 at 18:40, Steven Woody <[hidden email]> wrote:

I hesitate to use the colorscheme because it claims that I have to use
':qa' to quit the gvim.

There is absolutely no reason why you should use the “darkroom” color scheme. I use moria with that DLL and it works perfectly.
--
Benoit Mortgat
39, cours Albert Thomas
69003 Lyon, France
+33 4 27 78 31 27 / +33 6 17 15 41 58

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Transparent background for Windows version of gvim

Christian Brabandt
In reply to this post by Woody Wu

Hi Steven!

On Mi, 21 Okt 2009, Steven Woody wrote:

>
> On Tue, Oct 20, 2009 at 10:16 PM, Christian Brabandt <[hidden email]> wrote:
> > " You need the darkroom colorscheme from
> > http://www.vim.org/scripts/script.php?script_id=2246
>
> I hesitate to use the colorscheme because it claims that I have to use
> ':qa' to quit the gvim.

I posted an example on how I use VimTweak. You don't need that
particular colorscheme. Use whatever you want. And BTW, it is general
list consensus to avoid top posting and trim quotes.

regards,
Christian
--
:wq

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Transparent background for Windows version of gvim

Woody Wu

On Wed, Oct 21, 2009 at 5:26 AM, Christian Brabandt <[hidden email]> wrote:

>
> Hi Steven!
>
> On Mi, 21 Okt 2009, Steven Woody wrote:
>
>>
>> On Tue, Oct 20, 2009 at 10:16 PM, Christian Brabandt <[hidden email]> wrote:
>> > " You need the darkroom colorscheme from
>> > http://www.vim.org/scripts/script.php?script_id=2246
>>
>> I hesitate to use the colorscheme because it claims that I have to use
>> ':qa' to quit the gvim.
>
> I posted an example on how I use VimTweak. You don't need that
> particular colorscheme. Use whatever you want. And BTW, it is general
> list consensus to avoid top posting and trim quotes.

sorry... where is the example and how VimTweak related with
transparent background? Maybe I missed something information ...



--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Transparent background for Windows version of gvim

Christian Brabandt

On Wed, October 21, 2009 2:40 am, Steven Woody wrote:
> sorry... where is the example and how VimTweak related with
> transparent background? Maybe I missed something information ...

:call libcallnr("vimtweak.dll", "SetAlpha", <digit>)

Where digit can be any value between 1 and 255, the lower the value the
more transparently will vim become.

regards,
Christian
--
:wq


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Transparent background for Windows version of gvim

rickywu

I have tried to use vimtweak.dll, but my Vim became very slow when move
cursor.
Is this function need high requirement of GPU?
like :call libcallnr("vimtweak.dll", "SetAlpha", 220)

> :call libcallnr("vimtweak.dll", "SetAlpha", <digit>)
>
> Where digit can be any value between 1 and 255, the lower the value the
> more transparently will vim become.
>


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---