Saturday, January 30, 2010

Re: Change vim/gvim colorschemes

On Jan 30, 11:52 am, Christian Brabandt <cbli...@256bit.org> wrote:
> 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')

Thank you guys for all the replays.

I tried Chirstian Brabandt script, but did not manage to really figure
out how to use it.
I put the script in ~/.vim/plugin/ and ~/.vim/autoload/ and even tried
sourcing it.

I'm reading the help of the functions used in the script. Any further
help on this would be appreciated.

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

No comments: