Sunday, June 3, 2012

Re: exists("##ColorScheme")

Hello Christian,


Excerpt from Christian Brabandt:

-- <snip> --
>> Then is there a possibility to check for the availability of an colorscheme
>> other then 'filereadable(expand(expand("~/.vim/colors/desert.vim")))' ?
>
> Well, this should also work:
>
> echo globpath(&rtp, 'colors/desert.vim')

:echo globpath(&rtp, 'colors/desert.vim')
/home/$USER/.vim/colors/desert.vim
/usr/share/vim/vim73/colors/desert.vim

However:
:if globpath(&rtp, 'colors/desert.vim') | echo "yes" | else | echo "no" | endif
no

I probably could write a function that ':ru colors/desert.vim' and then checks
for 'g:colors_name' being set to a specific value.
The bad about this would be it adds additional seeks of the runtimepath which i
expect to be more expensive then the above version. Therefor i stick with the
above solution.

Thank you Christian nevertheless.
>
> regards,
> Christian
>

--
Regards,
Thilo

4096R/0xC70B1A8F
721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment