Skip to content
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 for fstab #2926

Closed
awebeer256 opened this issue Sep 16, 2023 · 5 comments · Fixed by #2933
Closed

Syntax highlighting for fstab #2926

awebeer256 opened this issue Sep 16, 2023 · 5 comments · Fixed by #2933

Comments

@awebeer256
Copy link

Description of the problem or steps to reproduce

Micro appears to have no syntax highlighting for fstab files. Meanwhile, Nano at least highlights comments in them.

Specifications

Commit hash: 225927b
OS: Fedora 38
Terminal: Konsole

@JoeKar
Copy link
Collaborator

JoeKar commented Sep 16, 2023

A possible solution could be to represent it with the ini filetype by adding it to runtime/syntax/ini.yaml.
But at the end this would mean adding dozens of files without any extensions to the ini filetype.

Maybe nano already found a good compromise by using a default syntax definition in case no other syntax highlighting fits.
Vim on the other hand respects the fstab with a dedicated definition, but this maybe goes a bit too far.

Currently I suggest to do it more or less the same as nano does, but the micro way.

@JoeKar
Copy link
Collaborator

JoeKar commented Sep 20, 2023

Currently I suggest to do it more or less the same as nano does, but the micro way.

I'm currently working on a basic default/fallback highlighting. Maybe it will fit the needs.

@zyedidia
Copy link
Owner

Do fstab files not have an extension?

@JoeKar
Copy link
Collaborator

JoeKar commented Oct 16, 2023

Nope, they don't.
A longer discussion in #2933 is ongoing what's needed or not in the default.yaml.

I would appreciate your opinion too. :)

@JoeKar
Copy link
Collaborator

JoeKar commented Apr 18, 2024

Currently I'm unsure if closing this ticket with #2933 was a good decision, since the initial issue isn't really fixed. We now only have a default fallback doing some minimal highlighting for plain text.
Would this fit your needs...

{
    "/etc/*": {
        "filetype": "ini"
    },
    [...]
}

...in ~/.config/micro/settings.json?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants