-
-
Notifications
You must be signed in to change notification settings - Fork 239
Feature request: Add ability to set default/fallback grammar for files without extensions or not common files #1083
Description
Problem:
Many system and config files have no extension or other extensions (Makefile, Dockerfile, nftables.conf, lfrc etc.). Currently there's no way to apply syntax highlighting to these files without listing each filename explicitly in the language config.
Current workaround attempt (doesn't work):
"text": {
"grammar": "bash",
"highlighter": "auto",
"comment_prefix": "#"
}The text language doesn't apply the bash grammar to files without extensions, even though bash grammar exists and works fine for .sh files.
Suggested solutions:
- Make
textlanguage grammar actually work for extensionless files - Allow wildcard or empty string in extensions:
"extensions": ["*"]or"extensions": [""] - Add editor-level default grammar:
"editor": { "default_grammar": "bash" }
Use case:
System administrators and DevOps engineers work with many extensionless config files that would benefit from bash-like syntax highlighting (comments, strings, variables). Example: /etc/* in linux system
Workaround:
Currently must list every single filename explicitly, which is impractical for hundreds of config files.