-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syntax highlighting missing for conf and config files #2179
Comments
You can create your own custom syntax highlighting files for Micro. Here's a rough attempt I wrote for .conf files. It's based on the syntax highlighting for Apache config files and so assumes comments begin with #. Save it to ~/.config/micro/syntax/conf.yaml filetype: conf
detect:
filename: "(\\.(conf)$|\\.(cfg)$)"
rules:
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?" |
Someone could open a pull request to add built-in syntax highlighting for |
@zoomosis Thanks! |
Bump for this issue. Possibly an easy fix to do ourselves, but it would be nice as default! |
In general, it would be nice if micro just let me associate filetypes with an existing syntax highlighting. There has never been a time I opened an "unknown" filetype and was glad it was uncolored. The "ini" syntax highlighting is an extremely sane default. A general space/tab/comma/etc delimited syntax would be a nice addition as well for "wall of text" files like I would either: examples that accomplish this: "Rainbow mode" as fallback highlighting
|
Default syntax highlighting was discussed and implemented in #2933 (not in the latest release yet so you need to build from git to get the feature). The default doesn't include .ini syntax but you may provide your own
You can achieve this by having the following in your {
"*.conf": {
"filetype": "ini"
},
}
This is a separate issue (you should probably open a separate issue for discussion if you feel strongly about it) but I think it would be rather tricky to implement with the current regex-based syntax highlighting system. |
Something I don't understand is that on Debian 11 (current oldstable) with micro v2.0.8, Does it mean micro used to have a definition syntax for conf files that was removed in a later release? Edit: I found it, it was commit 975e78d which removed the conf syntax highlighting definition (too many conflicts apparently) |
Description of the problem or steps to reproduce
Unlike nano, micro seems to be missing syntax highlighting for .conf and config files among other file types. If it wasn't for this, I'd move over from nano in a heartbeat. Thanks.
Specifications
Commit hash: micro 2.0.10-1
OS: Arch Linux
Terminal: kitty, alacritty
The text was updated successfully, but these errors were encountered: