Saturday, February 25, 2023

Augmenting filetype detection for supplemental types

Attempting to set multiple filetypes based on something like

autocmd FileType foo if ... | set filetype=foo.bar | endif

seems to have an ordering problem with the FileType autocmd that sets
'syntax' -- the "foo.bar" filetype is set, requisite files for "bar" are
loaded, and then the autocmd waiting on the original expansion of <afile>
to "foo" runs and effectively resets the syntax.

Is there a way to tack on a supplemental filetype without running into
this problem? The obvious approach of setting the whole string at once
works, but that requires duplicating everything that could otherwise
determine the initial filetype...

-Rob

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/d09426b9-d1d1-d70c-00b5-21b77a348618%40loonybin.net.

No comments: