This is a simple configuration file to add CUDA syntax highlighting to Vim.
Add the attached file in the syntax subdirectory of your vim installation ( under linux, it should be in /usr/share/vim/vim*/syntax, under Windows it should be under C:\Program Files\Vim\vim70\syntax).
The file should be renamed cu.vim.
You can modify/create the .vimrc file in your home directory adding this line:
au BufNewFile,BufRead *.cu set ft=cu
or you can add it for all the users by modifying the file filetype.vim in the vim directory, adding these 2 lines:
This works great for syntax highlighting. However, it appears I lose the ability to use folds with foldmethod=syntax. Do others see the same problem? Or can it be an issue of my configuration? I use above line to enable it for .cu files, but maybe it interferes with other settings of my rather massive .vimrc? If not, is there a workaround to enable folding? I’m not sufficiently familiar with the guts of vim to debug this issue.