Friday, December 27, 2013

Re: specific colorscheme for help files

On 27/12/13 07:05, Ben Fritz wrote:
> On Thursday, December 26, 2013 4:28:22 PM UTC-6, Steve wrote:
>> Hi,
>>
>>
>>
>> As I'm still learning vim (who isn't?), I'm often reading the help
>>
>> files. Typing ':h help' splits the window into two buffers which have
>>
>> the same colorscheme, which can be pretty confusing at some point.
>>
>> I'm trying to configure vim so that the help files are in a different
>>
>> colorscheme than the buffer I came from. First idea was to use the
>>
>> ftplugin mechanism. I thus created ~/.vim/ftplugin/help.vim in which I
>>
>> put:
>>
>>
>>
>> colorscheme darkblue
>>
>>
>>
>> This works for the help file, but as a side effect, it also changes the
>>
>> other buffer, which is obviously not what is desired.
>>
>>
>>
>> I then searched the Net and fell on a message by Gary Johnson dated
>>
>> December 27th, 2012 [1], saying it was not possible to do this. Further
>>
>> searches seemed to show other opinions, but nothing that I could use as
>>
>> is.
>>
>>
>>
>> Any help on this issue would be greatly appreciated.
>>
>>
>>
>
> I'm curious where you found "other opinions". Color schemes are global to all of Vim. There are no buffer-local or window-local color schemes. You could possibly hack a tab-local color scheme using TabEnter/TabLeave autocmds, but there's nothing built in even for that.
>

There are no buffer-local or window-local color schemes; however, most
of the highlight groups are filetype-specific; then they are linked to a
few "generic" groups. You could change the colours of most of the help
highlight groups by writing your own colorscheme, which would undo those
links for the highlight groups with names starting in help-, and define
a set of specific background and foreground colors for them. Of course,
this wouldn't change the colours for the "default" part of help files,
i.e. the (many) places where the syntax/help.vim defines no syntax
group, so that Vim falls back on the Normal highlight group to highlight
them.

A colorscheme is basically just a set of :highlight statements, with a
few housekeeping statements at the top and bottom. You can omit the :hi
statement for any group where you're content with the default colors
(those which you get without a colorscheme); otherwise, have a look at
the colorschemes distributed with Vim to get an idea of what is necessary.


Best regards,
Tony.
--
"No power of government ought to be employed in the endeavor to
establish any system or article of belief on the subject of religion."
[Jeremy Bentham, Constitutional Code from George
Seldes, The Great Quotations 1967, p. 813]

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment