Adds custom mapping for nginx and apache config files

This commit is contained in:
Niklas Mohrin 2020-08-16 22:15:59 +02:00 committed by David Peter
parent e305402212
commit ad18f070ae
1 changed files with 25 additions and 0 deletions

View File

@ -48,6 +48,31 @@ impl<'a> SyntaxMapping<'a> {
.insert("rails", MappingTarget::MapToUnknown)
.unwrap();
// Nginx and Apache syntax files both want to style all ".conf" files
// see #1131 and #1137
mapping
.insert("*.conf", MappingTarget::MapToUnknown)
.unwrap();
for glob in &[
"/etc/nginx/**/*.conf",
"/etc/nginx/sites-*/**/*",
"nginx.conf",
"mime.types",
] {
mapping.insert(glob, MappingTarget::MapTo("nginx")).unwrap();
}
for glob in &[
"/etc/apache2/**/*.conf",
"/etc/apache2/sites-*/**/*",
"httpd.conf",
] {
mapping
.insert(glob, MappingTarget::MapTo("Apache Conf"))
.unwrap();
}
for glob in [
"**/systemd/**/*.conf",
"**/systemd/**/*.example",