Vim syntax highlighting rules for modern CMakeLists.txt.
Original code from KitWare.First hosted on Github by Nicholas Hutchinson.Extended and modified by Patrick Boettcher and contributors
The code of this repository is integrated in and released with CMake and is pulledinto the official cmake-distribution "from time to time".
With Pathogen
cd ~/.vim/bundlegit clone git://github.com/pboettch/vim-cmake-syntax.git
With Vundle
" inside .vimrcPlugin 'pboettch/vim-cmake-syntax'
Updating with new keywords and commands needs to be done for new releases ofCMake. Simply ensure your cmake is newer than the previous version and run:
Please file a pull-request if the diff seems reasonable.
There is a ever growing test-suite based on ctest located in test/
cd <build-dir-where-ever-located>cmake path/to/this/repo/testctest
A TextMate grammar can be generated using the scripttextmate-grammar-from-cmake-help.py.
This grammar can be used in editors like Visual Studio Code (actually tested with vscode).
A custom cmake executable can be provided as argument as well as the output-file(default isCMake.tmLanguage.json).
python3 textmate-grammar-from-cmake-help.py \ --cmake /path/to/cmake \ --output /path/to/CMake.tmLanguage.json
When developing, the script can be run to put the file directly into the vscode-extensionpath:
python3 textmate-grammar-from-cmake-help.py \ --cmake /path/to/cmake \ --output ~/.vscode/extensions/ms-vscode.cmake-tools-<vers>/syntaxes/CMake.tmLanguage.json
Then the extension has to be disabled, restarted and enabled again to pick up the new grammar.