on master help sign in
Adds custom mapping for nginx and apache config files
commitad18f070aecfaeda6fa4dd7173c767517992d092 authorNiklas Mohrin <niklas.mohrin@gmail.com> dateSun 16 Aug 2020, 22:15 (6 years ago) parente305402
1 file changed+25
src/syntax_mapping.rs+25
src/syntax_mapping.rs+25
@@ -48,6 +48,31 @@ impl<'a> SyntaxMapping<'a> {
4848 .insert("rails", MappingTarget::MapToUnknown)
4949 .unwrap();
5050
51+ // Nginx and Apache syntax files both want to style all ".conf" files
52+ // see #1131 and #1137
53+ mapping
54+ .insert("*.conf", MappingTarget::MapToUnknown)
55+ .unwrap();
56+
57+ for glob in &[
58+ "/etc/nginx/**/*.conf",
59+ "/etc/nginx/sites-*/**/*",
60+ "nginx.conf",
61+ "mime.types",
62+ ] {
63+ mapping.insert(glob, MappingTarget::MapTo("nginx")).unwrap();
64+ }
65+
66+ for glob in &[
67+ "/etc/apache2/**/*.conf",
68+ "/etc/apache2/sites-*/**/*",
69+ "httpd.conf",
70+ ] {
71+ mapping
72+ .insert(glob, MappingTarget::MapTo("Apache Conf"))
73+ .unwrap();
74+ }
75+
5176 for glob in [
5277 "**/systemd/**/*.conf",
5378 "**/systemd/**/*.example",