diff --git a/ftdetect/cmake.vim b/ftdetect/cmake.vim new file mode 100644 index 0000000..11f748d --- /dev/null +++ b/ftdetect/cmake.vim @@ -0,0 +1,5 @@ +augroup cmake + autocmd! + autocmd BufNewFile,BufRead CMakeLists.txt,*.cmake setfiletype cmake + autocmd BufNewFile,BufRead CMakeCache.txt setfiletype cmakecache +augroup END diff --git a/syntax/cmakecache.vim b/syntax/cmakecache.vim new file mode 100644 index 0000000..8048b40 --- /dev/null +++ b/syntax/cmakecache.vim @@ -0,0 +1,30 @@ +" Vim syntax file +" Program: CMake - Cross-Platform Makefile Generator +" Version: cmake version 3.27.20230713-gdc88dd5 +" Language: CMake +" Author: Andy Cedilnik , +" Nicholas Hutchinson , +" Patrick Boettcher +" Maintainer: Dimitri Merejkowsky +" Former Maintainer: Karthik Krishnan +" Last Change: 2023 Jul 13 +" +" 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 b:current_syntax = 'cmakecache' + +syntax region cmakecacheComment start="#" end="$" +syntax region cmakecacheComment start="//" end="$" +syntax match cmakecacheKeyword /^\S*\ze:/ +syntax match cmakecacheType /:\zs\S*\ze=/ +syntax match cmakecacheConstant /=\zs.*/ + +highlight default link cmakecacheComment Comment +highlight default link cmakecacheKeyword Keyword +highlight default link cmakecacheType Type +highlight default link cmakecacheConstant Constant