Saturday, January 30, 2010

Re: Change vim/gvim colorschemes

Hi Athunye!

On Fr, 29 Jan 2010, Athunye wrote:

> I was wondering about a possibility to get vim change colorschemes
> from time
> to time, Say, every 5 or 10 minutes (automatically). Of course the
> 'sleep' command won't help
> in this case.
>
> The script would read the contents of a directory with the
> colorschemes, or the colorscheme names
> would be placed in a list, or whatever.
> As I run GNU/Linux, I thought that perhaps some interaction with bash
> would help.
> Any ideas are appreciated.

let g:mycolors = split(globpath(&rtp,"**/colors/*.vim"),"\n")
"change every 5 ticks
let g:mytick = 5

fun! s:ChangeColors()
exe 'so ' . g:mycolors[localtime() % len(g:mycolors)]
"unlet mycolors
endfun

aug MyColors
au!
au CursorHoldI,CursorHold * let g:mytick-=1 | if g:mytick<=0 | let g:mytick=5 | call s:ChangeColors() | endif
aug END


Mit freundlichen Grüßen
Christian
--
Ich konnte mich nur an einen Mann binden, der dasselbe verabscheute
wie ich: die Rechte, die brave Gesinnung, die Religion.
-- Simone de Beauvoir (über Jean-Paul Sartre, 'Der Lauf der Dinge')

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

No comments: