Files
CMake/cmake.vim.in
T
vim-cmake-syntax upstream 84dc53ad61 vim-cmake-syntax 2025-07-28 (3c8cd401)
Code extracted from:

    https://github.com/pboettch/vim-cmake-syntax.git

at commit 3c8cd4013fee999e1faa5c6444f946811603aaa3 (master).

Upstream Shortlog
-----------------

Craig Scott (1):
      589a68db Fix typo in dependency provider method keyword

Eisuke Kawashima (1):
      0fe3a3dd fix: add undo_indent

Patrick Boettcher (1):
      08fa8f49 update to cmake version 4.1.20250715-g2c3f83a

cos (9):
      4b296b4b fix update instructions
      6d4dbe64 silence vint linter
      d43f2050 silence perlcritic linter
      2b98e3b3 fix bash shebang for test runner
      396c7afc silence shellcheck + yamllint
      57a7c831 improve test portability
      13d84b42 add syntax folding
      c18bb8ec regenerate for folding
      3c8cd401 typofix

namniav (1):
      6b667c41 Fix syntax highlighting for bracket arguments and comments
2025-07-29 10:25:49 -04:00

140 lines
5.0 KiB
Plaintext

" Vim syntax file
" Program: CMake - Cross-Platform Makefile Generator
" Version: @VERSION@
" Language: CMake
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>,
" Nicholas Hutchinson <nshutchinson@gmail.com>,
" Patrick Boettcher <patrick.boettcher@posteo.de>
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
" Last Change: @DATE@
"
" Licence: The CMake license applies to this file. See
" https://cmake.org/licensing
" This implies that distribution with Vim is allowed
if exists('b:current_syntax')
finish
endif
let s:keepcpo= &cpoptions
set cpoptions&vim
syn cluster cmakeControl contains=
\ cmakeIf,
\ cmakeElse,
\ cmakeForeach,
\ cmakeWhile,
\ cmakeBlock,
\ cmakeFunction,
\ cmakeMacro
syn region cmakeBracketArgument start="\[\z(=*\)\[" end="\]\z1\]" fold contains=cmakeTodo,@Spell
syn region cmakeComment start="#\(\[=*\[\)\@!" end="$" contains=cmakeTodo,@Spell
syn region cmakeBracketComment start="#\[\z(=*\)\[" end="\]\z1\]" fold contains=cmakeTodo,@Spell
syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained
syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped
syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contains=cmakeVariableValue,cmakeProperty,cmakeGeneratorExpressions,cmakeTodo
syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped,@Spell
syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo,cmakeVariableValue
syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo
syn region cmakeArguments start="(" end=")" contains=ALLBUT,@cmakeControl,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo,@Spell fold
syn region cmakeIf matchgroup=cmakeKeyword start=/^\s*\<if\>/ end=/^\s*\<endif\>/ transparent fold contains=@cmakeControl,cmakeArguments
syn match cmakeElse /^\s*\<else\(if\)\?\>/ contained contains=NONE
syn region cmakeForeach matchgroup=cmakeKeyword start=/^\s*\<foreach\>/ end=/^\s*\<endforeach\>/ transparent fold contains=@cmakeControl,cmakeArguments
syn region cmakeWhile matchgroup=cmakeKeyword start=/^\s*\<while\>/ end=/^\s*\<endwhile\>/ transparent fold contains=@cmakeControl,cmakeArguments
syn region cmakeFunction matchgroup=cmakeKeyword start=/^\s*\<function\>/ end=/^\s*\<endfunction\>/ transparent fold contains=@cmakeControl,cmakeArguments
syn region cmakeBlock matchgroup=cmakeKeyword start=/^\s*\<block\>/ end=/^\s*\<endblock\>/ transparent fold contains=@cmakeControl,cmakeArguments
syn region cmakeMacro matchgroup=cmakeKeyword start=/^\s*\<macro\>/ end=/^\s*\<endmacro\>/ transparent fold contains=@cmakeControl,cmakeArguments
syn case match
syn keyword cmakeProperty contained
@PROPERTIES@
syn keyword cmakeVariable contained
@VARIABLE_LIST@
syn keyword cmakeModule contained
@MODULES@
@KEYWORDS@
syn keyword cmakeGeneratorExpressions contained
@GENERATOR_EXPRESSIONS@
syn case ignore
syn keyword cmakeCommand
@COMMAND_LIST@
\ nextgroup=cmakeArguments
syn keyword cmakeCommandDeprecated
@DEPRECATED@
\ nextgroup=cmakeArguments
syn case match
syn keyword cmakeTodo
\ TODO FIXME XXX
\ contained
hi def link cmakeBracketArgument String
hi def link cmakeBracketComment Comment
hi def link cmakeCommand Function
hi def link cmakeCommandDeprecated WarningMsg
hi def link cmakeComment Comment
hi def link cmakeElse Conditional
hi def link cmakeEnvironment Special
hi def link cmakeEscaped Special
hi def link cmakeGeneratorExpression WarningMsg
hi def link cmakeGeneratorExpressions Constant
hi def link cmakeKeyword Conditional
hi def link cmakeModule Include
hi def link cmakeProperty Constant
hi def link cmakeRegistry Underlined
hi def link cmakeString String
hi def link cmakeTodo TODO
hi def link cmakeVariableValue Type
hi def link cmakeVariable Identifier
@KEYWORDS_HIGHLIGHT@
" Manually added - difficult to parse out of documentation
syn case ignore
syn keyword cmakeCommandManuallyAdded
\ configure_package_config_file write_basic_package_version_file
\ nextgroup=cmakeArguments
syn case match
syn keyword cmakeKWconfigure_package_config_file contained
\ INSTALL_DESTINATION PATH_VARS NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO INSTALL_PREFIX
syn keyword cmakeKWconfigure_package_config_file_constants contained
\ AnyNewerVersion SameMajorVersion SameMinorVersion ExactVersion
syn keyword cmakeKWwrite_basic_package_version_file contained
\ VERSION COMPATIBILITY
hi def link cmakeCommandManuallyAdded Function
hi def link cmakeKWconfigure_package_config_file ModeMsg
hi def link cmakeKWwrite_basic_package_version_file ModeMsg
hi def link cmakeKWconfigure_package_config_file_constants Constant
let b:current_syntax = 'cmake'
let &cpoptions = s:keepcpo
unlet s:keepcpo
" vim: set nowrap: