preservim / vim-indent-guides

A Vim plugin for visually displaying indent levels in code
MIT License
2.62k stars 162 forks source link

E411: highlight group not found: Normal #131

Closed vectra-tme closed 6 years ago

vectra-tme commented 6 years ago

I am getting the following error:

Error detected while processing function <SNR>43_IndentGuidesToggle[1]..indent_guides#toggle[4]..indent_guides#enable[8]..indent_guides#init_    script_vars[7]..indent_guides#capture_highlight:
line    2:
 E411: highlight group not found: Normal  

I found several previous bugs that discuss color scheme workarounds so I added the following to .vimrc

 let g:indent_guides_auto_colors = 0
 hi IndentGuidesOdd  guibg=red   ctermbg=3
 hi IndentGuidesEven guibg=green ctermbg=4 
tylermolamphy commented 6 years ago

I am seeing the same, but only when opening vim via the terminal command alone, and landing at the welcome page." If I launch vim with any file as an argument, (or by calling -c and opening a vimwiki as I usually do,) I do not see the reported error.

The behavior started when I set let g:indent_guides_enable_on_vim_startup = 1.

screen shot 2018-04-24 at 18 45 54
ianyepan commented 6 years ago

Having the same issue here, but everytime I press to continue, it seems all right. I wonder if I can simply disable the promt.

ianyepan commented 6 years ago

Hey guys, I found a way to fix this!! It's because the highlight group name "Normal" wasn't defined. So just randomly define the highlight group name "Normal" in the _indentguides.vim file. (for me it's located in the '~/.vim/bundle/vim-indent-guides/autoload' folder What I did was simply put "highlight Normal ctermbg=NONE" in the first line and it works! No more errors. Hope it helps.

nathanaelkane commented 6 years ago

That's correct @ianpan870102, thanks for commenting.

Usually this happens when a colorscheme hasn't been explicitly set, or your colorscheme doesn't define colours for the Normal highlight group.