]> git.rmz.io Git - dotfiles.git/blobdiff - vim/syntax/qmake.vim
vim: add qmake syntax
[dotfiles.git] / vim / syntax / qmake.vim
diff --git a/vim/syntax/qmake.vim b/vim/syntax/qmake.vim
new file mode 100644 (file)
index 0000000..f22399f
--- /dev/null
@@ -0,0 +1,49 @@
+" qmake project syntax file
+" Language:     qmake project
+" Maintainer:   Arto Jonsson <ajonsson@kapsi.fi>
+" https://github.com/artoj/qmake-syntax-vim/
+
+if exists("b:current_syntax")
+    finish
+endif
+
+syntax case match
+
+" Comment
+syn match qmakeComment "#.*"
+
+" Variables
+syn match qmakeVariable /[A-Z_]\+\s*=/he=e-1
+syn match qmakeVariable /[A-Z_]\+\s*\(+\|-\||\|*\|\~\)=/he=e-2
+
+" Value of a variable
+syn match qmakeValue /$$[A-Z_]\+/
+syn match qmakeValue /$${[A-Z_]\+}/
+
+" Environment variable
+syn match qmakeEnvVariable /$([A-Z_]\+)/
+syn match qmakeEnvVariable /$$([A-Z_]\+)/
+
+" Qt build configuration
+syn match qmakeQtConfiguration /$$\[[A-Z_]\+\]/
+
+" Builtins
+" + contains
+" + CONFIG
+syn keyword qmakeBuiltin basename count dirname error exists
+syn keyword qmakeBuiltin find for include infile isEmpty join member message
+syn keyword qmakeBuiltin prompt quote sprintf system unique warning
+
+" Scopes
+syn match qmakeScope /[0-9A-Za-z_-]\+\(|\|:\)/he=e-1
+syn match qmakeScope /[0-9A-Za-z_-]\+\s*{/he=e-1
+
+hi def link qmakeComment Comment
+hi def link qmakeVariable Identifier
+hi def link qmakeBuiltin Function
+hi def link qmakeValue PreProc
+hi def link qmakeEnvVariable PreProc
+hi def link qmakeQtConfiguration PreProc
+hi def link qmakeScope Conditional
+
+let b:current_syntax = "qmake"