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

Comment and TODO #12

Open
egberts opened this issue Mar 31, 2020 · 0 comments
Open

Comment and TODO #12

egberts opened this issue Mar 31, 2020 · 0 comments

Comments

@egberts
Copy link

egberts commented Mar 31, 2020

I noticed that you haven't exactly supported comment (much less TODO/FIXME) yet.

I know for a fact that nginx.conf shares a very strong resemblance to ISC Bind9 named.conf configuration file's syntax.

I've been working on the vim-syntax-bind-named highlighter for this named.conf file. And it's pretty ALPHA at that point.

Maybe this snippet for your Vim syntax/nginx.vim will jumpstart you:

hi link namedError  Error
syn match namedError /[^;{#]$/

hi link namedToDo Todo
syn keyword namedToDo xxx contained XXX FIXME TODO TODO: FIXME:

syn region namedQuotedString start=/"/ skip=/\\"/ end=/"/ contained
syn region namedQuotedString start=/'/ skip=/\\'/ end=/'/ contained

" --- Other variants of strings
"  filespec = '_-.+~@$%^&*()=[]\\|:<>`?'  " no curly braces nor semicolon
"  filespec = can be unquoted but no space char allowed
hi link namedFilespec   String
syn match namedFilespec contained /[{}<>\|:;"'a-zA-Z0-9_\.\-\/\\]\+[^;]/ contains=namedQuotedString skipwhite skipempty skipnl 

hi link namedComment    Comment
syn match namedComment "//.*" contains=namedToDo
syn match namedComment "#.*" contains=namedToDo
syn region namedComment start="/\*" end="\*/" contains=namedToDo
syn match namedInclude /\_s*include/
\ nextgroup=namedFilespec,namedError
\ skipwhite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant