2

I am using Vim 7.4 through a remote PuTTY session. I set my "dracula" colorscheme in my vimrc, and then immediately after that, I remove the background setting for normal text. For Normal text, I personally prefer a solid (empty) black background to the background color that the dracula colorscheme uses. Here is the relevant code from my vimrc:

colorscheme dracula
hi Normal ctermfg=231 ctermbg=NONE cterm=NONE 

This works when I edit an HTML or text or JavaScript file, but if I edit a Perl file, the dracula colorscheme's default background is used instead. If I type :verbose hi Normal, it says "Last set from ~/.vim/bundle/vim-dracula/colors/dracula.vim" So it appears the colorscheme file is getting sourced twice: once during the normal loading of the .vimrc and another time later on. Unfortunately the :scriptnames command only shows the first time a file gets sourced. How do I find what is causing the dracula.vim file to be sourced again?

2 Answers 2

3

You can see when files are sourced with:

:set verbose=2

If that doesn't help you can try higher levels:

>= 1    When the viminfo file is read or written.
>= 2    When a file is ":source"'ed.
>= 5    Every searched tags file and include file.
>= 8    Files for which a group of autocommands is executed.
>= 9    Every executed autocommand.
>= 12   Every executed function.
>= 13   When an exception is thrown, caught, finished, or discarded.
>= 14   Anything pending in a ":finally" clause.
>= 15   Every executed Ex command (truncated at 200 characters).
1

It's not resolving the root of the problem, but you could try to override highlight groups each time the colorsheme is set:

augroup MyColorScheme
    autocmd!
    autocmd ColorScheme dracula highlight Normal ctermfg=231 ctermbg=NONE cterm=NONE
augroup END

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.