Is it possible to create additional subcategories of filetypes?
For example, it would be great if (neo)vim could pick up that the yaml file I'm editing is acutally a Kubernetes yaml file and set the filetype to something more specific:
setfiletype=yaml-kubernetes. For this example, this might be based on the extension AND the contents: e.g. 'apiVersion: v1'
Currently, the blunt filetype logic for yaml file detection is in /usr/share/nvim/runtime/filetype.vim and is based on file extension:
au BufNewFile,BufRead *.yaml,*.yml setf yaml
The solution I'm looking for ideally is to extend this in the users' config rather than to overwrite the system filetype.vim file.
This would allow user config to include filetype-specific shortcuts, for example enabling
kubectl apply -f % for relevant matched files (not applicable for all yaml files).