How to enable syntax highlighting for CUDA .cu and .cuh files in Vim?

cuda, syntax-highlighting, vim, vim-syntax-highlighting

Solution

Add these two lines to ~/.vimrc:

au BufNewFile,BufRead *.cu set ft=cuda
au BufNewFile,BufRead *.cuh set ft=cuda

And put cuda.vim in ~/.vim/syntax/

Have fun!

Problem

I found that my `~/.vimrc` file has `syntax on` but it didn't work for any CUDA file (`.cu`). Not sure to how to do it.

Original source