2015-12-05 02:57:01 +01:00
|
|
|
# Highlighting for common files in /etc
|
2017-11-03 08:34:41 +01:00
|
|
|
hook global BufCreate .*/etc/(hosts|networks|services) %{ set-option buffer filetype etc-hosts }
|
|
|
|
hook global BufCreate .*/etc/resolv.conf %{ set-option buffer filetype etc-resolv-conf }
|
|
|
|
hook global BufCreate .*/etc/shadow %{ set-option buffer filetype etc-shadow }
|
|
|
|
hook global BufCreate .*/etc/passwd %{ set-option buffer filetype etc-passwd }
|
|
|
|
hook global BufCreate .*/etc/gshadow %{ set-option buffer filetype etc-gshadow }
|
|
|
|
hook global BufCreate .*/etc/group %{ set-option buffer filetype etc-group }
|
|
|
|
hook global BufCreate .*/etc/(fs|m)tab %{ set-option buffer filetype etc-fstab }
|
|
|
|
hook global BufCreate .*/etc/environment %{ set-option buffer filetype sh }
|
|
|
|
hook global BufCreate .*/etc/env.d/.* %{ set-option buffer filetype sh }
|
|
|
|
hook global BufCreate .*/etc/profile(\.(csh|env))? %{ set-option buffer filetype sh }
|
|
|
|
hook global BufCreate .*/etc/profile\.d/.* %{ set-option buffer filetype sh }
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2019-03-13 19:15:59 +01:00
|
|
|
|
|
|
|
hook -once global BufSetOption filetype=etc-hosts %{
|
|
|
|
require-module etc-hosts
|
|
|
|
}
|
|
|
|
hook -once global BufSetOption filetype=etc-resolv-conf %{
|
|
|
|
require-module etc-resolv-conf
|
|
|
|
}
|
|
|
|
hook -once global BufSetOption filetype=etc-shadow %{
|
|
|
|
require-module etc-shadow
|
|
|
|
}
|
|
|
|
hook -once global BufSetOption filetype=etc-passwd %{
|
|
|
|
require-module etc-passwd
|
|
|
|
}
|
|
|
|
hook -once global BufSetOption filetype=etc-gshadow %{
|
|
|
|
require-module etc-gshadow
|
|
|
|
}
|
|
|
|
hook -once global BufSetOption filetype=etc-group %{
|
|
|
|
require-module etc-group
|
|
|
|
}
|
|
|
|
hook -once global BufSetOption filetype=etc-fstab %{
|
|
|
|
require-module etc-fstab
|
|
|
|
}
|
|
|
|
|
2015-12-05 02:57:01 +01:00
|
|
|
# Highlighters
|
2019-03-13 19:15:59 +01:00
|
|
|
|
|
|
|
provide-module etc-resolv-conf %{
|
2015-12-05 02:57:01 +01:00
|
|
|
## /etc/resolv.conf
|
2018-07-01 11:53:35 +02:00
|
|
|
add-highlighter shared/etc-resolv-conf group
|
|
|
|
add-highlighter shared/etc-resolv-conf/ regex ^#.*?$ 0:comment
|
|
|
|
add-highlighter shared/etc-resolv-conf/ regex ^(nameserver|server|domain|sortlist|options)[\s\t]+(.*?)$ 1:type 2:attribute
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2018-11-28 10:39:15 +01:00
|
|
|
hook -group etc-resolv-conf-highlight global WinSetOption filetype=etc-resolv-conf %{
|
|
|
|
add-highlighter window/etc-resolv-conf ref etc-resolv-conf
|
2018-12-11 00:11:35 +01:00
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-resolv-conf }
|
2019-03-13 19:15:59 +01:00
|
|
|
}}
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2019-03-13 19:15:59 +01:00
|
|
|
provide-module etc-hosts %{
|
2015-12-05 02:57:01 +01:00
|
|
|
## /etc/hosts
|
2018-07-01 11:53:35 +02:00
|
|
|
add-highlighter shared/etc-hosts group
|
|
|
|
add-highlighter shared/etc-hosts/ regex ^(.+?)[\s\t]+?(.*?)$ 1:type 2:attribute
|
|
|
|
add-highlighter shared/etc-hosts/ regex '#.*?$' 0:comment
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2018-11-28 10:39:15 +01:00
|
|
|
hook -group etc-hosts-highlight global WinSetOption filetype=etc-hosts %{
|
|
|
|
add-highlighter window/etc-hosts ref etc-hosts
|
2018-12-11 00:11:35 +01:00
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-hosts }
|
2019-03-13 19:15:59 +01:00
|
|
|
}}
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2019-03-13 19:15:59 +01:00
|
|
|
provide-module etc-fstab %{
|
2015-12-05 02:57:01 +01:00
|
|
|
## /etc/fstab
|
2018-07-01 11:53:35 +02:00
|
|
|
add-highlighter shared/etc-fstab group
|
|
|
|
add-highlighter shared/etc-fstab/ regex ^(\S{1,})\s+?(\S{1,})\s+?(\S{1,})\s+?(\S{1,})\s+?(\S{1,})\s+?(\S{1,})(?:\s+)?$ 1:keyword 2:value 3:type 4:string 5:attribute 6:attribute
|
|
|
|
add-highlighter shared/etc-fstab/ regex '#.*?$' 0:comment
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2018-11-28 10:39:15 +01:00
|
|
|
hook -group etc-fstab-highlight global WinSetOption filetype=etc-fstab %{
|
|
|
|
add-highlighter window/etc-fstab ref etc-fstab
|
2018-12-11 00:11:35 +01:00
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-fstab }
|
2019-03-13 19:15:59 +01:00
|
|
|
}}
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2019-03-13 19:15:59 +01:00
|
|
|
provide-module etc-group %{
|
2015-12-05 02:57:01 +01:00
|
|
|
## /etc/group
|
2018-07-01 11:53:35 +02:00
|
|
|
add-highlighter shared/etc-group group
|
|
|
|
add-highlighter shared/etc-group/ regex ^(\S+?):(\S+?)?:(\S+?)?:(\S+?)?$ 1:keyword 2:type 3:value 4:string
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2018-11-28 10:39:15 +01:00
|
|
|
hook -group etc-group-highlight global WinSetOption filetype=etc-group %{
|
|
|
|
add-highlighter window/etc-group ref etc-group
|
2018-12-11 00:11:35 +01:00
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-group }
|
2019-03-13 19:15:59 +01:00
|
|
|
}}
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2019-03-13 19:15:59 +01:00
|
|
|
provide-module etc-gshadow %{
|
2015-12-05 02:57:01 +01:00
|
|
|
## /etc/gshadow
|
2018-07-01 11:53:35 +02:00
|
|
|
add-highlighter shared/etc-gshadow group
|
|
|
|
add-highlighter shared/etc-gshadow/ regex ^(\S+?):(\S+?)?:(\S+?)?:(\S+?)?$ 1:keyword 2:type 3:value 4:string
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2018-11-28 10:39:15 +01:00
|
|
|
hook -group etc-gshadow-highlight global WinSetOption filetype=etc-gshadow %{
|
|
|
|
add-highlighter window/etc-gshadow ref etc-gshadow
|
2018-12-11 00:11:35 +01:00
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-gshadow }
|
2019-03-13 19:15:59 +01:00
|
|
|
}}
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2019-03-13 19:15:59 +01:00
|
|
|
provide-module etc-shadow %{
|
2015-12-05 02:57:01 +01:00
|
|
|
## /etc/shadow
|
2018-07-01 11:53:35 +02:00
|
|
|
add-highlighter shared/etc-shadow group
|
|
|
|
add-highlighter shared/etc-shadow/ regex ^(\S+?):(\S+?):([0-9]+?):([0-9]+?)?:([0-9]+?)?:([0-9]+?)?:([0-9]+?)?:([0-9]+?)?:(.*?)?$ 1:keyword 2:type 3:value 4:value 5:value 6:value 7:value 8:value
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2018-11-28 10:39:15 +01:00
|
|
|
hook -group etc-shadow-highlight global WinSetOption filetype=etc-shadow %{
|
|
|
|
add-highlighter window/etc-shadow ref etc-shadow
|
2018-12-11 00:11:35 +01:00
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-shadow }
|
2019-03-13 19:15:59 +01:00
|
|
|
}}
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2019-03-13 19:15:59 +01:00
|
|
|
provide-module etc-passwd %{
|
2015-12-05 02:57:01 +01:00
|
|
|
## /etc/passwd
|
2018-07-01 11:53:35 +02:00
|
|
|
add-highlighter shared/etc-passwd group
|
|
|
|
add-highlighter shared/etc-passwd/ regex ^(\S+?):(\S+?):([0-9]+?):([0-9]+?):(.*?)?:(.+?):(.+?)$ 1:keyword 2:type 3:value 4:value 5:string 6:attribute 7:attribute
|
2015-12-05 02:57:01 +01:00
|
|
|
|
2018-11-28 10:39:15 +01:00
|
|
|
hook -group etc-passwd-highlight global WinSetOption filetype=etc-passwd %{
|
|
|
|
add-highlighter window/etc-passwd ref etc-passwd
|
2018-12-11 00:11:35 +01:00
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/etc-passwd }
|
2019-03-13 19:15:59 +01:00
|
|
|
}}
|