I would like to be able to create a vim syntax file for a specific project, to highlight identifiers unique to that project. I could, of course, install a syntax file in $HOME/.vim/after/syntax/*.vim
but I want to set this up as a per-folder configuration. The project syntax file should add on to the existing syntax file, not replace it. I also want a general solution that automatically loads a local file it if exists, and doens't need to be configured for specific directories in .vimrc or in a plugin.
Edit: This is similar to the question Vim: apply settings on files in directory but that deals with settings in .vimrc, which is loaded before syntax files. Syntax files conventionally wipe out predefined syntax information, so it is not useful to set this infomration in .vimrc, and the techniques to load alternate .vimrc files are therefore not helpful. I don't know of a way to trigger additional "after" files to be loaded. I have seen this question asked before but no answers except those pertaining to .vimrc.
I have configured local .vimrc files using :set exrc
and have verified that these files get loaded, but syntax definitions in .vimrc get overwritten by syntax files that are loaded later on. (And I want project syntax to add to standard syntax, not replace it.)
Is a similar functionality, whether a vim feature or a plugin, that can be used for local "after" syntax files?