zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.95k stars 1.17k forks source link

Syntax highlighting is bad? #3167

Closed og900aero closed 6 months ago

og900aero commented 7 months ago

I use Debian 12 stable with alacritty. I try micro editor compared with nano, and I find that micro is able to recognize which syntax highlighting to use for much fewer files, than nano. It does not recognize such popular config files as fail2ban, interfaces, nftables, etc. Meanwhile, nano minimum colors the comments, but also the [] parts indicating groups in the case of fail2ban. Will Micro not be developed from this point of view?

JoeKar commented 7 months ago

The syntax highlighting isn't bad, but has room for optimization/extension. I already suggested with #2933 an PR to include an default scheme, as nano does for unknown file types. But this will be quite limited and does, as of now, not highlight any braces. What you expect is the highlighting of the ini file type, which I apply for /etc/* too ~/.config/micro/settings.json:

{
    "/etc/*": {
        "filetype": "ini"
    },
    [...]
}
og900aero commented 6 months ago

"/etc/*": { "filetype": "ini" },

Thx, working. The only problem with this is that inside the at etc folder it will also show what would otherwise be a normal syntax highlightning. A default would certainly be nice. According to this, the developer is not willing to do this?

JoeKar commented 6 months ago

According to this, the developer is not willing to do this?

We're on a good way to get more extended rights to support the project owner. :wink:

og900aero commented 6 months ago

According to this, the developer is not willing to do this?

We're on a good way to get more extended rights to support the project owner. 😉

Good to hear that! Because I would not like to go back to nano :)