I’ve created a new filetype, “usenet,” for Usenet messages. I would like files with this filetype to be highlighted exactly as if they had the “mail” filetype. Is it possible to tell Vim that I want to reuse the existing “mail” syntax definitions for this other filetype?
What I’ve tried
I tried writing
setlocal syntax=mailin the
ftplugin/usenet.vimfile but this seemed to be ignored—running
:set syntax?in a file with the “usenet” filetype just produced
I also tried copying the
mail.vimsyntax file from
~/.vim/syntax, renaming it to
usenet.vim, and changing the line
let b:current_syntax = "mail"
let b:current_syntax = "usenet"
This worked, but if a future version of Vim improves the
mail.vimfile then I would have to go through this process again (and it’s unlikely that I would even notice such a change in the first place). What I want, semantically, is to highlight “usenet” files as if they were “mail” files, which seems like it should be possible.