:colorscheme default
The filetype is php.
Can anyone help me to find out the highlight rule ?
:hi[light]
will list all defined rules with a preview. You can also query single items:
:hi Keyword
To manually look up any syntax group under the cursor, there are choices. Mine is a function bounded to a key like this:
" Show syntax highlighting groups for word under cursor
nmap <F2> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
It'll list every syntax group the word belongs to.
I've had the following snippet tucked away for a while now, not sure where I got it. This will set your statusline to show the highlight group of the word currently under the cursor:
:set statusline=%{synIDattr(synIDtrans(synID(line('.'),col('.'),1)),'name')}
This will update your statusline as you move around the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With