Closed liamrlawrence closed 6 months ago
Hey o/
I really do appreciate the idea, but as posted yesterday here. I do not plan to maintain code logic for multiple file types.
I'd like to keep the plugin as lightweight and easy to maintain as possible.
Hey there, love the plugin.
I've had this feature locally for a while since it's the only thing that I’m missing. I was going to spend some more time on it before making a PR, but then I saw yesterday that you closed #28. I thought that even if you reject the changes you still might find the ideas interesting and the solution straightforward.
Thanks again for all the work you've done.
Filetype options
Allows users to specify what filetypes are highlighted by the plugin, including the ability to override "default" / "global" options set at the top level of the config.
Changes
New setup option
filetypes
. This table accepts filetypes as strings (e.g."css"
), or as named tables containing overrides for the other options (e.g.css = { enable_tailwind = true }
). The default value is{ "all" }
which is a special case that enables highlighting for all files.During setup
options
to thefiletype_options
tableWhen an autocmd is triggered it will check to see if the filetype has changed, and if so updates
options
usingfiletype_options
(Note that if using the default config{ "all" }
then the filetype never changes, it always resolves to"all"
). Autocommands also now use patterns and have been assigned to a group.New table util function
merge(base, incoming)
that returns a copy of the base table after merging in the incoming table.