Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add syntax highlight for CMakeCache.txt #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ftdetect/cmake.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
augroup cmake
autocmd!
autocmd BufNewFile,BufRead CMakeLists.txt,*.cmake setfiletype cmake
autocmd BufNewFile,BufRead CMakeCache.txt setfiletype cmakecache
augroup END
30 changes: 30 additions & 0 deletions syntax/cmakecache.vim
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>,
" Nicholas Hutchinson <[email protected]>,
" Patrick Boettcher <[email protected]>
" Maintainer: Dimitri Merejkowsky <[email protected]>
" Former Maintainer: Karthik Krishnan <[email protected]>
" 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