├── README.mkd └── plugin └── transparency-windows.vim /README.mkd: -------------------------------------------------------------------------------- 1 | transparency-windows-vim 2 | ======================== 3 | 4 | windows port of https://vim-jp.org/vim-users-jp/2011/10/05/Hack-234.html 5 | 6 | require 7 | ------- 8 | 9 | https://github.com/mattn/vimtweak 10 | 11 | install 12 | ------- 13 | 14 | If you use pathogen-vim or something similar, 15 | 16 | vimfiles: 17 | bundle: 18 | vimtweak: 19 | (git clone https://github.com/mattn/vimtweak) 20 | transparency-windows-vimtweak: 21 | (git clone https://github.com/mattn/transparency-windows-vim) 22 | 23 | If you don't use pathogen-vim, 24 | 25 | vimfiles: 26 | vimtweak.dll 27 | plugin: 28 | transparency-windows.vim 29 | 30 | screenshot 31 | ---------- 32 | 33 | ![](http://go-gyazo.appspot.com/db5c1c7c8b0f9323.png) 34 | -------------------------------------------------------------------------------- /plugin/transparency-windows.vim: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | 3 | if &cp || (exists('g:loaded_transparency_windows_vim') && g:loaded_transparency_windows_vim) 4 | finish 5 | endif 6 | 7 | let g:loaded_transparency_windows_vim = 1 8 | 9 | if !has('gui_running') || (!has('win32') && !has('win64')) 10 | finish 11 | endif 12 | 13 | let s:dll = get(g:, 'vimtweak_dll_path', '') 14 | if empty(s:dll) 15 | let s:dll = get(split(globpath(&rtp, has('win64') ? 'vimtweak64.dll' : 'vimtweak32.dll'), '\n'), 0, '') 16 | if empty(s:dll) 17 | finish 18 | endif 19 | endif 20 | 21 | function! s:Transparency(v) 22 | call libcallnr(s:dll, 'SetAlpha', 255-a:v) 23 | endfunction 24 | 25 | function! s:Install(flag) 26 | augroup TransparencyWindows 27 | autocmd! 28 | if a:flag =~# '^\(1\|[tT]rue\|[yY]es\)$' 29 | autocmd FocusGained * call s:Transparency(get(g:, 'Transparency_FocusGained', 20)) 30 | autocmd FocusLost * call s:Transparency(get(g:, 'Transparency_FocusLost', 50)) 31 | endif 32 | augroup END 33 | endfunction 34 | 35 | command! -nargs=1 Transparency call Install() 36 | command! -nargs=1 TransparencyChange call Transparency() 37 | 38 | Transparency Yes 39 | --------------------------------------------------------------------------------