0

Is there a current syntax highlighting file for GRUB configuration files? If so, where may I find it?

I recently edited /etc/default/grub (via sudoedit) and found that vim did no syntax highlighting for it. Filetype was set to CONF; when I changed it to GRUB, there was still no syntax highlighting.

A check on /usr/local/share/vim/vim90/syntax/grub.vim shows it was last updated in 2006, whereas GRUB 2 was released in 2012, so I'm assuming the current syntax file is for GRUB Legacy.

EDIT 2022-07-31: In response to a good suggestion below, I was able to track down the person whom I believe to be the original maintainer. (One is never guaranteed to keep the same e-mail address for sixteen years.) I've contacted him and have yet to receive a response.

1 Answer 1

1

If filetype was set wrong then reset it manually. If it happens too often then fix it by :h ftdetect once and forever;

If syntax is outdated ping syntax maintainer. If syntax is abandoned search web for alternative implementation;

If none found then go and write it yourself. If you believe it's a new gem then contribute it to Vim and become the new better syntax maintainer;

If you can't find it and don't want to create it then you can live without it.

8
  • I neglected to mention that i did change the filetype to GRUB and that the highlighting was still absent. thank you for pointing out my omission. My question has been edited.
    – MDeBusk
    Jul 31, 2022 at 6:37
  • I did search the Web. i found nothing, which is why I'm posting here. And I currently lack the knowledge necessary for writing it myself... again, which is why I'm asking here. Of course I can live without it. It's not as if I edit grub configs for a living. But it seems odd that one would assert that my choices are limited to "find it on the Web, do it yourself, or pound sand." Which, again, is why I'm asking here.
    – MDeBusk
    Jul 31, 2022 at 6:41
  • @MDeBusk Why do you think it's odd? Syntaxes do not write themselves. People do. Bram only maintains few of them. All others are written and supported by volunteers. That's what is OpenSource about.
    – Matt
    Jul 31, 2022 at 6:48
  • I think it's odd because it seems to me that "ask some knowledgeable people" should be among my choices. is that not what this site is for?
    – MDeBusk
    Jul 31, 2022 at 7:00
  • @MDeBusk There are responces and there are responces. Writing usable syntax (even a simple one and even by "a knowledgeable person") could easily take a day or two. Asking other people if they like wasting such period of time looks odd to me. If I were you I'd rather spend a week and figured it myself.
    – Matt
    Jul 31, 2022 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.