Getting current colorscheme in a vim script

1,574 views
Skip to first unread message

Pablo Giménez

unread,
Oct 15, 2009, 3:03:23 PM10/15/09
to vim...@googlegroups.com
Hi
Is there any way to get the name of the current colorscheme used in a vim script???
thx

--
Un saludo
Best Regards
Pablo Giménez

sc

unread,
Oct 15, 2009, 3:12:26 PM10/15/09
to vim...@googlegroups.com
On Thursday 15 October 2009, Pablo Giménez wrote:

> Is there any way to get the name of the current colorscheme
> used in a vim script???

if the scheme is properly written it has a line assigning its
name to the global variable 'colors_name', for example:

let g:colors_name = "biogoo"

so you can query and use that

hth,

sc

Pablo Giménez

unread,
Oct 16, 2009, 7:10:01 AM10/16/09
to vim...@googlegroups.com


2009/10/15 sc <toot...@swbell.net>


On Thursday 15 October 2009, Pablo Giménez wrote:

> Is there any way to get the name of the current colorscheme
> used in a vim script???

if the scheme is properly written it has a line assigning its
name to the global variable 'colors_name', for example:

let g:colors_name = "biogoo"
Thanks that works perfectly.
Now my problem is that in the colors scheme menu only appears the colors in the /usr/share/vim71/colors.
But I have add to the runtime another path using in my ~/.vimrc:
 " Set runtime paths
set runtimepath="/opt/myVim",$VIMRUNTIME

in /opt/myVim I have a folder called colors with my colorscheme, it  works perfectly with the :colorscheme command, so vim can find the color script, but it doesn't appear in the color scheme menu.
Any to include it in the vim menu?????
thx


so you can query and use that

hth,

sc


John Little

unread,
Oct 16, 2009, 7:46:42 PM10/16/09
to vim_use


On Oct 17, 12:10 am, Pablo Giménez <pablog...@gmail.com> wrote:

> But I have add to the runtime another path using in my ~/.vimrc:
>  " Set runtime paths
> set runtimepath="/opt/myVim",$VIMRUNTIME

Those quotes are causing trouble. A double quote is vim's comment
marker. If I execute that, runtimepath becomes blank.

Regards, John

Tony Mechelynck

unread,
Nov 15, 2009, 12:05:57 PM11/15/09
to vim...@googlegroups.com, Pablo Giménez
On 16/10/09 13:10, Pablo Giménez wrote:
>
>
> 2009/10/15 sc <toot...@swbell.net <mailto:toot...@swbell.net>>
Set that option before the menus are sourced (the ":filetype" and
":syntax" commands may source them implicitly in gvim), and with no
quotes in the option, e.g.

set rtp^=/opt/myVim rtp+=/opt/myVim/after
filetype plugin indent on
syntax on
" etc.

Note the use of ":set" with ^= (insert before) and += (insert after) so
the standard locations (such as ~/.vim and ~/.vim/after, which, unlike
what you wrote above, are login-name-dependent) will still be used if
populated.

And BTW, Vim 7.1 is old hat by now. The current stable version is
7.2.293 as of this writing.


Best regards,
Tony.
--
No part of this message may reproduce, store itself in a retrieval
system, or transmit disease, in any form, without the permissiveness of
the author.
-- Chris Shaw
Reply all
Reply to author
Forward
0 new messages