New answers tagged syntax-highlighting
3
To shed some light on what's going on. As you probably know, HTML originates from SGML. In SGML they could write something like that:
<!ELEMENT some serious stuff
--
Some stupid comments
that can even spread across multiple lines
--
more serious stuff
-- More stupid comments --
>
BTW. Note there's no space between <! and ELEMENT, but ...
3
This was a bug in Vim's HTML syntax, which @Matt has fixed with lightning-speed.
Upgrade to an upcoming version of Vim to fix this, or simply copy runtime/syntax/html.vim from Matt's fork into ~/.vim/syntax to try out his fix immediately.
0
I figured it out.
redir => foo | silent syntax list SomeGroup | redir END
2
About :match
With the match command, you only get 3 match ids:
:match noteHi /\[\cNOTE:[^=]*\]/
:2match todoHi /\[\cTODO:[^=]*\]/
:3match what /ever/
Each time you call these commands for a particular id (1,2,3) you replace whatever was there before. So you can have 3 different ones but that's it, only 3. If you need more, use matchadd().
About matchadd()
...
1
Vim syntax is a beast. It takes some time to get used to it.
I suggest to try this:
scriptencoding utf-8
syn match coqSubscript keepend /\K\d\+/ms=s+1 transparent contains=coqSubscriptDigit
\ containedin=ALLBUT,coqComment,coqRequire,coqSubscript,coqSubscriptDigit
syn match coqSubscriptDigit /0/ contained conceal cchar=₀
syn match coqSubscriptDigit /1/ ...
2
There's no built in way to do what you want to do, but you can build your way there with some vimscript.
Here's an example:
function! Tester(line)
if match(a:line, '(.*)') >= 0
return '(.*)'
endif
if match(a:line, '\.') >= 0
return '\.\S*'
endif
return ''
endfunction
function! Recolor()
call clearmatches()
...
2
It’s LineNr and CursorLineNr.
2
Try this:
" ~/.vim/after/syntax/matlab.vim
highlight link matlabCellComment SpecialComment
You can also use plain Comment
1
As Matt notes, smartindent is enough. Not only this, but cindent is actively harmful!
Many years ago, when I first got started with vim, I had these both set globally in my vimrc. Eventually, through spurious indenting issues such as these, I came to realize that in fact they make bad global settings. cindent is too specific; it works for C stuff. Don't set ...
0
There's no need in cindent, as smartindent should be enough. So simply:
setlocal smartindent cinwords=
0
I have found an acceptable solution.
First, use the solution provided in the Vim wiki to highlight trailing whitespace. i.e. add to ~/.vimrc:
autocmd BufReadPost,InsertEnter * match TrailingWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match TrailingWhitespace /\s\+$/
highlight TrailingWhitespace ctermbg=blue
Then, handle gitcommit using special rules. ...
0
This is quite a crude way to do it. Though from the various highlighting tag plugins I found -- such as https://github.com/xolox/vim-easytags and https://github.com/ludovicchabant/vim-gutentags -- this was the only solution that worked to capture all the items I wanted to grab.
Here's a python script that will generate additional tags for enums, typedefs, ...
Top 50 recent answers are included
Related Tags
syntax-highlighting × 580vimrc × 52
highlight × 49
colorscheme × 45
vimscript × 39
regular-expression × 36
filetype × 22
filetype-tex × 19
filetype-markdown × 18
conceal × 18
folding × 16
gvim × 13
terminal × 12
filetype-python × 12
filetype-c × 12
neovim × 11
color × 10
spell-checking × 9
filetype-html × 8
filetype-javascript × 8
keyword × 8
plugin-system × 7
comments × 7
autocompletion × 6
microsoft-windows × 6