I’m trying to set up some prettier highlighting for Vdebug.

I had a look at the source, and it says I need to target a DbgBreakptLine (I don’t know what they are called, but it’s the thing you put after hi).

But if I put:

hi DbgBreakptLine ctermbg=NONE ctermfg=NONE

in my vim color scheme, it does nothing. However, Pasting this into a session has the desired effect. I can only conclude that Vdebug is clobbering my chosen styles by taking precedence somehow. But how? Is it running after my color scheme? I don’t think so, because the first thing my .vimrc does is load pathogen, then selects my color scheme.

Given this, I had a look around the internet for any solutions to plugins overwriting config, but I couldn't find anything useful.

The relevant part of my .vimrc:

execute pathogen#infect()
call pathogen#helptags()

colorscheme maxbucknell


I had a look at this question, and thought I would look at :scrip, which shows which files are loaded when. Sure enough, plugins are loaded after colors. Ideally I'd like some way of customising this, without changing the plugin, or doing something hacky like putting the command inside .vim/after.

  • ~/.vim/after is not "hacky" at all. – romainl Jul 19 '14 at 21:42
  • @romainl Is that the best way to do it? Perhaps "hacky" is the wrong word, but it sure doesn't feel elegant. – Max Bucknell Jul 19 '14 at 21:48

Did you notice that the plugin actually defines the style of that highlight group?

hi default DbgBreakptLine term=reverse ctermfg=White ctermbg=Green guifg=#ffffff guibg=#00ff00

Since it is sourced after your ~/.vimrc and your colorscheme it will override any rule with the same name.

That's not very clean, unfortunately, so you basically have three workable options:

  • change the colors right there in the plugin,

  • move those lines from the plugin to your colorscheme and edit them to your liking,

  • add these lines to your ~/.vimrc:

    augroup MyColors
        autocmd ColorScheme * highlight DbgBreakptLine ctermbg=NONE ctermfg=NONE
    augroup END

Using the ~/.vim/after/ directory is not a hack at all: it's under-documented for sure but it's usually a lot cleaner than the equivalent mess in your ~/.vimrc. Anyway, I'm not sure it works for your specific needs. You could try this plugin (never tried) but I'm not sure what you want deserves another plugin in your setup.


It turns out you can do it with ~/.vim/after/ but that solution actually looks quite "hacky" to me as it mixes "plugins" and "colorschemes". Whatever, just put this line in ~/.vim/after/plugin/foo.vim (the part before the dot of the file name doesn't matter):

hi DbgBreakptLine ctermbg=NONE ctermfg=NONE
  • The plugins is correctly using :hi default ..., so if there's an earlier DbgBreakptLine definition, that command will be ineffective, as desired. – Ingo Karkat Jul 20 '14 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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