Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- augroup highlight_sentences_that_end_with_colon
- au!
- " SOURCE: https://stackoverflow.com/a/30552423/490748
- " Add highlights to commented text.
- au Syntax * syn match moreTodo /\v([[:space:]]|^)@<=([[:alnum:].][^\]})])@=([[:space:]]=[^[:space:]]+)+(:)@<=([[:space:]]|$)@=/ contained containedin=.*Comment.*
- " Add highlights to non-commented text.
- au Syntax text,vimwiki syn match moreTodo /\v([[:space:]]|^)@<=([[:alnum:].][^\]})])@=([[:space:]]=[^[:space:]]+)+(:)@<=([[:space:]]|$)@=/
- hi def link moreTodo Todo
- " hi def link moreTodo Title
- " hi def link moreTodo Question
- " hi def link moreTodo Statement
- augroup END
- " There are subtle differences between these two statements.
- "
- " The first statement highlights matches in commented text. The beginning of the
- " statement, "au Syntax *", allows it to highlight in all filetypes. However the
- " ending of the statement, "contained containedin=.*Comment.*", constrains it to
- " filetypes with highlight groups named "Comment", or contains the word "Comment",
- " i.e. program-language filetypes that Vim knows how to highlight.
- "
- " The second statement highlights matches in non-commented text. The beginning of
- " the statement, "au Syntax text,vimwiki", constrains it to text and vimwiki files.
Add Comment
Please, Sign In to add comment