I'm trying to debug my Vimrc config files but I can't find the file where the error is coming from, is there a way to find the file that the line is coming from?
For example, I'm given this error:
Error detected while processing function <SNR>28_HL:
line 43:
E254: Cannot allocate color 0
E421: Color name or number not recognized: ctermbg= gui=NONE cterm=NONE
This doesn't tell me where the file that the error is occuring is, I have tried doing vim -V9myvim.log and rooting for the error which gives me this:
line 15: sourcing "/usr/local/share/vim/vim80/syntax/syncolor.vim"
finished sourcing /usr/local/share/vim/vim80/syntax/syncolor.vim
continuing in /Users/thermatix/dotfiles/tag-vim/vim/plugged/gruvbox/colors/gruvbox.vim
Searching for "/usr/local/share/vim/vimfiles/after/syntax/syncolor.vim"
Searching for "/Users/thermatix/dotfiles/tag-vim/vim/plugged/vim-snipmate/after/syntax/syncolor.vim"
Searching for "/Users/thermatix/dotfiles/tag-vim/vim/plugged/vim-polyglot/after/syntax/syncolor.vim"
Searching for "/Users/thermatix/dotfiles/tag-vim/vim/plugged/vim-javascript/after/syntax/syncolor.vim"
Searching for "/Users/thermatix/dotfiles/tag-vim/vim/plugged/tern_for_vim/after/syntax/syncolor.vim"
Searching for "/Users/thermatix/dotfiles/tag-vim/vim/plugged/vim-coffee-script/after/syntax/syncolor.vim"
Searching for "/Users/thermatix/dotfiles/tag-vim/vim/plugged/jedi-vim/after/syntax/syncolor.vim"
Searching for "/Users/thermatix/dotfiles/tag-vim/vim/plugged/ale/after/syntax/syncolor.vim"
Searching for "/Users/thermatix/dotfiles/tag-vim/vim/plugged/vim-markdown/after/syntax/syncolor.vim"
Searching for "/Users/thermatix/.vim/after/syntax/syncolor.vim"
Error detected while processing function <SNR>28_HL:
line 43:
E254: Cannot allocate color 0
E421: Color name or number not recognized: ctermbg= gui=NONE cterm=NONE
finished sourcing /Users/thermatix/dotfiles/tag-vim/vim/plugged/gruvbox/colors/gruvbox.vim
continuing in /usr/local/share/vim/vim80/syntax/synload.vim
Executing ColorScheme Auto commands for "gruvbox"
But this isn't that helpful because before it was <SNR>32_HL, then I removed tabular (which was the last loaded plugin before the error) and it change to <SNR>28_HL.
Is the error in Searching for "/Users/thermatix/.vim/after/syntax/syncolor.vim"?
Can't be because there is no after folder.
I also tried doing grep -r 'ctermbg= gui=NONE cterm=NONE' .vim/ but that found nothing, and grep-ing for the individual attributes found nothing that seem to be related to the error.
I've also tried using vim -D to try and step through but again, it seems to jump lines till the error happens without actually staging where the error is, so I can't tell where the problem lies, you just get this:
Entering Debug mode. Type "cont" to continue.
/Users/thermatix/.vimrc
line 1: so ~/.vim/vimrc.vim
>
>n
Error detected while processing function <SNR>28_HL:
line 43:
E254: Cannot allocate color 0
E421: Color name or number not recognized: ctermbg= gui=NONE cterm=NONE
/Users/thermatix/.vimrc
line 2: End of sourced file
>
So how do I find where the error is coming from? I mean, telling me the line number is all well and good but it's useless without the file that it's coming from.
If you find the need, my vim config files can be found here.
.vimand not.vimrcnot sure why I typed that but thanks for pointing that out, still doesn't change that it found nothing. – Thermatix Oct 19 '17 at 11:11:scriptnamesto find out, which script uses the<snr>28prefix. That is usually faster finding the error than using the debugger. – Christian Brabandt Oct 19 '17 at 12:18scriptnameswould match theSNRidentifier. – mMontu Oct 19 '17 at 15:17:h <SNR>– Christian Brabandt Oct 19 '17 at 18:50