I am using MacVim and have colours set on .html documents. I working on various projects that are using the Sparkview Engine for .Net MVC. These files end in .spark. How do I in my .vimrc file set the .spark extensions to map to .html so all my colourations appear on .spark files too?
As other answers have mentioned, you can use the vim set command to set syntax. :set syntax=<type> where <type> is something like perl , html , php , etc. There is another mechanism that can be used to control syntax highlighting called filetype , or ft for short.
Settings file used by Vim, a text editing program often used by source code developers and system administrators; saves the default settings for the editor when it is opened; allows users to customize options for the editor. VIMRC files are saved in a plain text format.
You can use the following in your .vimrc
autocmd BufRead,BufNewFile *.spark set filetype=html
It means that every time you open or create a new spark file, the file type is set to html for the current buffer. And the appropriate syntax highlighting should be applied.
Use an autocommand:
au BufNewFile,BufRead *.spark setfiletype html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With