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

Add support for nanorc #4335

Closed
4 tasks done
perlun opened this issue Nov 22, 2018 · 14 comments · Fixed by #4343
Closed
4 tasks done

Add support for nanorc #4335

perlun opened this issue Nov 22, 2018 · 14 comments · Fixed by #4343

Comments

@perlun
Copy link

perlun commented Nov 22, 2018

Preliminary Steps

Please confirm you have...

Problem Description

nano is a very commonly available console-based text editor for GNU/Linux and other systems. It's often installed by default, or easily installable using apt-get or similar mechanisms. Its configuration file is called ~/.nanorc.

It would be great if linguist would provide support (syntax highlighting) for nanorc files. This issue exists to track adding this support.

Here is a reasonably complete syntax definition that could be used if anyone feels like looking into this: https://github.com/perlun/dotfiles/blob/master/nano/syntax/nanorc.nanorc (this file in itself uses the nanorc syntax, so it can also be used as an example)

URL of the affected repository:

Example file: https://github.com/perlun/dotfiles/blob/master/nanorc

Last modified on:

2018-11-22

Expected language:

nanorc

Detected language:

None

@Alhadis
Copy link
Collaborator

Alhadis commented Nov 30, 2018

This would actually be a good idea. Dotfile repos are extremely common on GitHub, and many hackers tend to dig through them looking for tricks. Syntax highlighting for .nanorc files would certainly reach many users.

By the same token, other .*rc files would also benefit from syntax highlighting, such as .curlrc. The only part that bothers me is that the addition would be purely aesthetic, and we don't even have highlighting/classification for .gitignore files (the single most common manifest file in Git repositories).

@pchaigno Any thoughts?

@pchaigno
Copy link
Contributor

I'm all for it, but do we have a Sublime Text, Atom, or TextMate grammar we could use to highlight these files?

@perlun
Copy link
Author

perlun commented Nov 30, 2018

@pchaigno Maybe this could be of help?

Looked for TextMate or Sublime but couldn't find any.

@Alhadis
Copy link
Collaborator

Alhadis commented Nov 30, 2018

I'm tempted to hack one together, because we could leverage our existing grammar for highlighting regular expressions — all we'd need is a wrapper for it and some .nanorc-specific keyword patterns. 👍

The otgo/highlight-nanorc grammar appears somewhat flaky. Notice the inconsistent highlighting.

@pchaigno
Copy link
Contributor

pchaigno commented Dec 1, 2018

I'm tempted to hack one together

@Alhadis How much time would you need? Should we use otgo/highlight-nanorc in the meantime?

@Alhadis
Copy link
Collaborator

Alhadis commented Dec 1, 2018

Already finished. Lol...

Haven't published it yet. I'll do so now.

Alhadis added a commit to Alhadis/language-etc that referenced this issue Dec 1, 2018
@Alhadis
Copy link
Collaborator

Alhadis commented Dec 1, 2018

There you go. =) How's this?

@pchaigno
Copy link
Contributor

pchaigno commented Dec 1, 2018

There you go. =) How's this?

Great!

@perlun Do you want to open a pull request (see point 2 of Adding a language) to use @Alhadis' new grammar for nanorc?

@Alhadis
Copy link
Collaborator

Alhadis commented Dec 1, 2018

I'll see how many more grammars I can get ticked off that repository's readme before he submits the PR... 😁

@pchaigno
Copy link
Contributor

pchaigno commented Dec 5, 2018

@Alhadis If you want to submit the pull request to use your grammar, go ahead, I don't think @perlun is going to...

@Alhadis
Copy link
Collaborator

Alhadis commented Dec 5, 2018

Will do. Should I add the grammars I wrote for .gitignore, .gitattribute and .gitconfig files too? They're, uh, damn near airtight in their syntax and tailored specifically to GitHub's colour scheme...

@pchaigno
Copy link
Contributor

pchaigno commented Dec 5, 2018

👍

We should probably group the corresponding languages under a common parent language.

@Alhadis
Copy link
Collaborator

Alhadis commented Dec 5, 2018

I guess INI will do. =)

@perlun
Copy link
Author

perlun commented Dec 9, 2018

@Alhadis If you want to submit the pull request to use your grammar, go ahead, I don't think @perlun is going to...

Yeah, sorry, I didn't see this until now and I'm pretty certain @Alhadis is a more experienced contributor to the project anyway. =) So, I'm happy to delegate the work in this case. 😉

Many thanks for looking into it! 👍

@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants