Reputation: 615
I have *.q
files ( that are very similar to other SQL ) and I want to make vim syntax highlight it in the same way as SQL.
Upvotes: 0
Views: 1166
Reputation: 9273
Include it in the ~/.vim/filetype.vim
, as described at Vim FAQ 26.8:
" my filetype file
if exists("did_load_filetypes")
finish
endif
augroup filetypedetect
au! BufRead,BufNewFile *.x setfiletype c
augroup END
For this case it would be changed to something like this:
au! BufRead,BufNewFile *.q setfiletype sql
Check :help new-filetype
for additional details.
Upvotes: 2
Reputation: 615
create a ~/.vim/ftdetect
directory if not existing.
create a ~/.vim/ftdetect/<new-file-type-extention>.vim
with content:
au BufRead,BufNewFile *.<new-file-type-extention> set filetype=<existing-file-type-extention>
Upvotes: 4