开发者

What is the vim groupname of the '<? ?>' tag in an xml file?

I am doing my own colorscheme and I would like to cus开发者_高级运维tomize the tag from XML files.

<?xml version="1.0" encoding="UTF-8"?>

But I can't find the name of the groupname.

Any one knows it ?


According to xml.vim, the xml syntax elements and Vim groups are:

 +-------> xmlProcessingDelim: Comment
 | 
 |    +----------> xmlProcessing: Type
 |    |
 |    |         +--> xmlString: String
 |    |         |
 v    v         v
<?xml version="1.0"?>

Something in your colorscheme like:

hi Comment guifg=#999999

Might achieve the desired result of coloring <? ?>


I've had a look in syntax/xml.vim, and there's a region called xmlProcessing that might be what you're looking for? This is then mapped to the 'Type' group.


To get all names of all groups that affect highlighting of a symbol under cursor, use

echo 'Normal '.join(map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")'))

It will echo something like this:

Normal helpHyperTextEntry helpStar

(it is for star in tags in help files).

You may want to use

echo 'Normal '.join(map(synstack(line('.'), col('.')), 'synIDattr(synIDtrans(v:val), "name")'))

as well. More info at :h synstack() and :h synIDtrans().

After you found a name of desired group you can put something like

hi xmlProcessingDelim ctermbg=Yellow

into ~/.vim/after/syntax/xml.vim.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜