Add option to skip filetype-specific colors (again)#120
Conversation
Cool as they are, they lead to problems when switching to this colorscheme and then back to a different one, thus an option to disable them will make life easier for many users.
|
@DarkWiiPlayer Creativity +1 😆 👍 |
|
*poke* |
|
Hi, Sorry for the late response, I didn't forget this. I originally planned to implement this feature in a different way but never got time to do so. I guess I can do it after Thanksgiving :). Here are the reasons: First of all, it's not advised to introduce the usage of an arbitrary global variable. I try to keep all options as key/value pairs within 1 single global variable for PaperColor: g:PaperColor_Theme_Options (see the README usage). And there is a mechanism in which the option only affects an intended scope, either only a variant (dark/light) or both variants of a theme whether it is the default PaperColor or some other theme; yes, it's possible to have multiple themes on PaperColor -- I didn't advertise this feature enough but here is an example in case you wonder https://github.com/NLKNguyen/papercolor-blue ). What I have in mind is to introduce an option, say let g:PaperColor_Theme_Options = {
\ 'theme': {
\ 'default': {
\ 'highlight_only_standard_groups': 1
\ }
\ }
\ }In case you wonder how to do add the option In the code, you see this. It's where you can introduce a new theme option. fun! s:generate_theme_option_variables()
" 0. All possible theme option names must be registered here
let l:available_theme_options = [
\ 'allow_bold',
\ 'allow_italic',
\ 'transparent_background',
\ 'highlight_only_standard_groups',
\ ]
A script variable will automatically be created as Second, instead of having a big if-block like the PR, that function can be terminated right after the standard highlighting groups and be done. if s:themeOpt_highlight_only_standard_groups == 1
return
endifHope this helps. I'll implement this the next time I set up Vim again. Or if you implement as I suggested and test, then I can pull. Thanks! |
Same as #119 but without indentation for easier diffing :)