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=mail
in theftplugin/usenet.vim
file but this seemed to be ignored—running:set syntax?
in a file with the “usenet” filetype just producedusenet
.I also tried copying the
mail.vim
syntax file from$VIMRUNTIME/syntax
into~/.vim/syntax
, renaming it tousenet.vim
, and changing the linelet b:current_syntax = "mail"
to
let b:current_syntax = "usenet"
This worked, but if a future version of Vim improves the
mail.vim
file 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.