Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight keywords like COMBAK, TODO, FIXME, XXX #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions syntax/twig.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
" Version: 1.0
"
" Based Jinja syntax by: Armin Ronacher <armin.ronacher@active-4.com>
"
"
" Known Bugs:
" because of odd limitations dicts and the modulo operator
" appear wrong in the template.
Expand Down Expand Up @@ -57,8 +57,11 @@ syn region twigVarBlock matchgroup=twigVarDelim start=/{{-\?/ end=/-\?}}/ contai
" Jinja template 'raw' tag
syn region twigRaw matchgroup=twigRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,twigTagBlock,twigVarBlock,twigString,twigComment

" Keywords to highlight within comments
syn keyword twigTodo contained COMBAK TODO FIXME XXX

" Jinja comments
syn region twigComment matchgroup=twigCommentDelim start="{#" end="#}" containedin=ALLBUT,twigTagBlock,twigVarBlock,twigString
syn region twigComment matchgroup=twigCommentDelim start="{#" end="#}" contains=twigTodo containedin=ALLBUT,twigTagBlock,twigVarBlock,twigString

" Block start keywords. A bit tricker. We only highlight at the start of a
" tag block and only if the name is not followed by a comma or equals sign
Expand Down Expand Up @@ -101,6 +104,7 @@ if version >= 508 || !exists("did_twig_syn_inits")
HiLink twigString Constant
HiLink twigNumber Constant
HiLink twigComment Comment
HiLink twigTodo Todo

delcommand HiLink
endif
Expand Down