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

Forcing syntax highlighting for file X #3551

Closed
ThomDietrich opened this issue Apr 4, 2017 · 7 comments
Closed

Forcing syntax highlighting for file X #3551

ThomDietrich opened this issue Apr 4, 2017 · 7 comments

Comments

@ThomDietrich
Copy link

ThomDietrich commented Apr 4, 2017

This is an example and can be adopted to a lot of cases.

I've got a samba configuration file (smb.conf) and it ends with the vim modeline # vim: filetype=samba, which is necessary as the filename can change and vim would identify it incorrectly.

Is there a way to overwrite the Linguist syntax highlighting (on GitHub, see link above) with a specific language (in this case "ini") without compromising the vim modeline / function. The setting smb.conf linguist-language=ini in gitattributes doesn't seem to have any effect.

@pchaigno
Copy link
Contributor

pchaigno commented Apr 4, 2017

The setting smb.conf linguist-language=ini in gitattributes doesn't seem to have any effect.

Do you have a link to the repository where you tried that? You might need to state the absolute path.

@ThomDietrich
Copy link
Author

The link is hidden behind smb.conf above :)
I've tried the absolute path as well. Let me re-add this change so you can have a look.

@ThomDietrich
Copy link
Author

ThomDietrich commented Apr 9, 2017

@pchaigno any other way I can help resolve this issue?

@ThomDietrich
Copy link
Author

@pchaigno not trying to be pushy ... :)

@pchaigno
Copy link
Contributor

@ThomDietrich Sorry for the delay :S

The file looks highlighted as expected (meaning, as an INI file). What were you expecting to be different?

@ThomDietrich
Copy link
Author

@pchaigno now it is indeed working, even without the gitattributes setting. I swear it didn't when I was creating the issue 😅
I'll close the issue, reopen if I encounter the problem again. Thanks for your help!

@ThomDietrich
Copy link
Author

Everyone encountering similar issues: settings inside .gitattributes need some time to propagate through GitHub. Just give it a few hours.

@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

No branches or pull requests

2 participants