Closed ghost closed 5 years ago
Hey there! I just pushed up a fix to this issue...I was doing well and everything, setting up my own sandbox environment to reproduce this fully...and then I noticed that this issue also happened with my own setup. D'oh!
So, this was definitely a missing feature in this theme. If you refer to the commit that I marked as resolving this (https://github.com/ErichDonGubler/vim-sublime-monokai/commit/0a5df59324c43d44b74d39f94077d55e589573ae), the relevant group is javaExternal
. Since you're interested in knowing how to debug this yourself (perhaps for future PRs? :smile:), I'll teach you what I know! I have two main techniques, neither of which I will claim are perfect or complete:
I have a custom function in my vimrc
that prints out the highlight group stack for the position under the cursor. This gets me 95% of the way to figuring out how things are being grouped and usually lets me write the correct highlight
statements:
fun! s:SyntaxStack()
if !exists('*synstack')
return
endif
return map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
command! -nargs=0 EchoHighlightingGroup echo s:SyntaxStack()
" This is my preferred mapping -- don't feel like you need to use this.
nnoremap <leader>0 :EchoHighlightingGroup<CR>
If the above doesn't immediately make sense, a good first round of learning might come from the vim
docs for syntax
, particularly the highlight
section.
Perusing the source for some highlighting plugins for languages has been necessary where, in some VERY rare cases, my synstack
binding above doesn't show a group I'm pretty sure is being highlighted. If you ever have to use this technique and your sanity feels challenged at some point...know that it's normal, and that I'd be more than happy to help you out. In that case, feel free to make an issue here again or to reach out to me via email -- it's $MY_GITHUB_USERNAME
at gmail dot com. :slightly_smiling_face:
Hi guys -
Could you help me debug what's going on with my setup? I'm not too familiar with creating syntax highlighting definitions in Vim yet. The import list and package are not getting highlighted at all in Java in my setup. C# and typescript I don't have this issue with.
If I use other colorschemes I see
package
andimport
getting highlighted, so wondering if it's an issue with the copy of this colorscheme?What I did:
call vundle#end() filetype plugin indent on
set encoding=utf-8
syntax on set bg=dark
set termguicolors let g:sublimemonokai_term_italic = 1 colorscheme sublimemonokai