Skip to content

Instantly share code, notes, and snippets.

@lucasdicioccio
Last active September 11, 2023 11:54
Show Gist options
  • Save lucasdicioccio/0d973ca0189cc054b1b0d2d80ddb2213 to your computer and use it in GitHub Desktop.
Save lucasdicioccio/0d973ca0189cc054b1b0d2d80ddb2213 to your computer and use it in GitHub Desktop.
a VIM syntax highlight for MiniZinc
" Vim syntax file
" Language: MiniZinc
" Maintainer: Lucas DiCioccio
" Latest Revision: 02 May 2020
if exists("b:current_syntax")
finish
endif
" keywords
syn keyword mznKeywords constraint predicate function annotation
syn keyword mznKeywords output solve satisfy maximize minimize
syn keyword mznKeywords if then else
syn keyword mznKeywords include assert
syn keyword mznKeywordsFunc forall exists sum let in where trace
syn keyword mznTypes var array set enum of int bool float opt ann
syn keyword mznTodo contained TODO FIXME XXX NOTE
syn match mznComment "%.*$" contains=mznTodo
syn match mznSymbols "<->"
syn match mznSymbols "->"
syn match mznSymbols "/\\"
syn match mznSymbols "\\/"
let b:current_syntax = "mzn"
hi def link mznTodo Todo
hi def link mznComment Comment
hi def link mznKeywords Constant
hi def link mznSymbols Constant
hi def link mznKeywordsFunc PreProc
hi def link mznTypes Type
@vp2177
Copy link

vp2177 commented Sep 9, 2023

Would be awesome if this was upstreamed into Vim + NeoVim

@lucasdicioccio
Copy link
Author

Hi @vp2177, I must admit I've never tried contributing to these upstreams.
I'll take this comment as some show of interest => I'll give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment