Vim syntax for xaml files
So you’re using Windows and want to edit your xaml files every once in a while with vi/vim/gvim, but vim doesn’t recognize xaml as an xml file and doesn’t give you nice syntax highlighting? Simple fix. In your home directory, create a vimfiles/ftdetect/myrules.vim
file with the following contents:
" We set the type to XML only if no type was detected yet
au BufRead,BufNewFile *.xaml setfiletype xml
" OR unconditionally
"au BufRead,BufNewFile *.xaml set filetype=xml
Would throwing this at the bottom of your source file not also work?
<!– vim: tw=120 ts=4 sw=4 et enc=utf8 syn=xml –>
Regards,
Sammy
@Samantha Bordeau
Yes, using that modeline would work as well. You would have to do it for every xaml file though. If you set up the file type detection in vim you only have to do it once and it applies to all xaml files.