I am writing a plugin where a certain filetype must possess their own syntax highlight. Therefore I have created
.
├── ...
├── plugin
└── syntax
and syntax/newfiletype.vim
containing
syntax clear
syntax match MyPattern /regexpattern/
highlight default link MyPattern Title
where regexpattern
is a valid regex pattern that matches, say, vim search or vim regex functions, but that however does not work when having to match for syntax highlight. In the particular case at hand I want to highlight all lines containing dashes at the start of the line, therefore /^--.*/
. The same happens if instead of the -
one uses any other non-alphanumerical character.
Problem: regex pattern ^--
(or any similar one) does not work for the filetype in question when for syntax highlight.
verbose set filetype?
shows what you expect—if the filetype is new, I would expect to see an ftdetect (and possibly ftplugin instead of/in addition to plugin) directory.