2

For most files, Vim (terminal) is syntax highlighting properly without any issues. However, I am unable to get it to work for CMakeLists.txt:

enter image description here

Neovim has no trouble with syntax highlighting, neither does gvim. I also tried this plugin with no effect: https://github.com/pboettch/vim-cmake-syntax

I have the following in my .vimrc

filetype plugin indent on
syntax on
set t_Co=256
au BufNewFile,BufRead *.cmake,CMakeLists.txt set filetype=cmake
# tried this variation too
# autocmd BufEnter *.cmake,CMakeLists.txt,*.cmake.in :setlocal filetype=cmake
0

The issue it turns out is a conflict with the Rainbow Parenthesis plugin: https://github.com/kien/rainbow_parentheses.vim, which is too bad as it's a nice plugin but the syntax highlighting functionality is more important.

For future reference, the following variant of the Rainbow Parenthesis plugin is also problematic: https://github.com/luochen1990/rainbow

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.