cmake.vim.in 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. " Vim syntax file
  2. " Program: CMake - Cross-Platform Makefile Generator
  3. " Version: @VERSION@
  4. " Language: CMake
  5. " Author: Andy Cedilnik <[email protected]>,
  6. " Nicholas Hutchinson <[email protected]>,
  7. " Patrick Boettcher <[email protected]>
  8. " Maintainer: Dimitri Merejkowsky <[email protected]>
  9. " Former Maintainer: Karthik Krishnan <[email protected]>
  10. " Last Change: @DATE@
  11. "
  12. " Licence: The CMake license applies to this file. See
  13. " https://cmake.org/licensing
  14. " This implies that distribution with Vim is allowed
  15. if exists("b:current_syntax")
  16. finish
  17. endif
  18. let s:keepcpo= &cpo
  19. set cpo&vim
  20. syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
  21. syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell
  22. syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
  23. syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained
  24. syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped
  25. syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contains=cmakeVariableValue,cmakeProperty,cmakeGeneratorExpressions,cmakeTodo
  26. syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped
  27. syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo
  28. syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo
  29. syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo
  30. syn case match
  31. syn keyword cmakeProperty contained
  32. @PROPERTIES@
  33. syn keyword cmakeVariable contained
  34. @VARIABLE_LIST@
  35. syn keyword cmakeModule contained
  36. @MODULES@
  37. @KEYWORDS@
  38. syn keyword cmakeGeneratorExpressions contained
  39. @GENERATOR_EXPRESSIONS@
  40. syn case ignore
  41. syn keyword cmakeCommand
  42. @COMMAND_LIST@
  43. \ nextgroup=cmakeArguments
  44. syn keyword cmakeCommandConditional
  45. @CONDITIONALS@
  46. \ nextgroup=cmakeArguments
  47. syn keyword cmakeCommandRepeat
  48. @LOOPS@
  49. \ nextgroup=cmakeArguments
  50. syn keyword cmakeCommandDeprecated
  51. @DEPRECATED@
  52. \ nextgroup=cmakeArguments
  53. syn case match
  54. syn keyword cmakeTodo
  55. \ TODO FIXME XXX
  56. \ contained
  57. hi def link cmakeBracketArgument String
  58. hi def link cmakeBracketComment Comment
  59. hi def link cmakeCommand Function
  60. hi def link cmakeCommandConditional Conditional
  61. hi def link cmakeCommandDeprecated WarningMsg
  62. hi def link cmakeCommandRepeat Repeat
  63. hi def link cmakeComment Comment
  64. hi def link cmakeEnvironment Special
  65. hi def link cmakeEscaped Special
  66. hi def link cmakeGeneratorExpression WarningMsg
  67. hi def link cmakeGeneratorExpressions Constant
  68. hi def link cmakeModule Include
  69. hi def link cmakeProperty Constant
  70. hi def link cmakeRegistry Underlined
  71. hi def link cmakeString String
  72. hi def link cmakeTodo TODO
  73. hi def link cmakeVariableValue Type
  74. hi def link cmakeVariable Identifier
  75. @KEYWORDS_HIGHLIGHT@
  76. " Manually added - difficult to parse out of documentation
  77. syn case ignore
  78. syn keyword cmakeCommandManuallyAdded
  79. \ configure_package_config_file write_basic_package_version_file
  80. \ nextgroup=cmakeArguments
  81. syn case match
  82. syn keyword cmakeKWconfigure_package_config_file contained
  83. \ INSTALL_DESTINATION PATH_VARS NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO INSTALL_PREFIX
  84. syn keyword cmakeKWconfigure_package_config_file_constants contained
  85. \ AnyNewerVersion SameMajorVersion SameMinorVersion ExactVersion
  86. syn keyword cmakeKWwrite_basic_package_version_file contained
  87. \ VERSION COMPATIBILITY
  88. hi def link cmakeCommandManuallyAdded Function
  89. hi def link cmakeKWconfigure_package_config_file ModeMsg
  90. hi def link cmakeKWwrite_basic_package_version_file ModeMsg
  91. hi def link cmakeKWconfigure_package_config_file_constants Constant
  92. let b:current_syntax = "cmake"
  93. let &cpo = s:keepcpo
  94. unlet s:keepcpo
  95. " vim: set nowrap: