forked from pboettch/vim-cmake-syntax
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add syntax highlight for CMakeCache.txt
Fix pboettch#28
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |