diff options
author | Niklas Mohrin <niklas.mohrin@gmail.com> | 2020-08-16 22:15:59 +0200 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2020-09-14 10:36:22 +0200 |
commit | ad18f070aecfaeda6fa4dd7173c767517992d092 (patch) | |
tree | 452e9a7c6a964f2a05991ad4099a566b6f179ab1 /src | |
parent | e3054022127d0323ccea1ac4ee752c9f8a36b914 (diff) |
Adds custom mapping for nginx and apache config files
Diffstat (limited to 'src')
-rw-r--r-- | src/syntax_mapping.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs index 4441429a..96ce7fc6 100644 --- a/src/syntax_mapping.rs +++ b/src/syntax_mapping.rs @@ -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", |