How do I get a specific file extension to behave as if .html in .vimrc file?
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 colou开发者_如何学Gorations appear on .spark files too?
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
精彩评论