As a PhpStorm user, one of the disappointing things I come across when I try using Vim is the way it does syntax highlighting in HTML:
Vim colours just the tagname and attributes,leaving the <, / and > in a different colour. What's the point of that? I find this distracting compared to the view I get in PhpStorm:
(Ignore the different colour scheme.) I find it harder to read code with all those <
and >
characters. How I can modify Vim to do this?
I'm using the monokai colour scheme for Vim.
You don't need to modify the HTML syntax itself - this can all be done by overriding the default links. syntax/html.vim
defines syntax groups for the various HTML elements, and (at the end of the script) then links those to certain highlight groups, the appearance of which is determined by your colorscheme. If you establish a different link (in your ~/.vimrc
), this will be honored. So, to make the entire tag appear like the tag name, use this:
highlight link htmlTag htmlTagName
highlight link htmlEndTag htmlTagName