Syntax highlighting for your hosts file
Syntax highlighting for your hosts file;
/etc/hosts on Linux and macOS,
C:\Windows\System32\Drivers\etc\hosts (?) on Windows.
This is a complete rewrite of an older Hosts package that provided more or less the same thing, except of course for some improvements:
- It only highlights IP addresses that are actually viable. For example: it won’t match the impossible movie IP-address
189.23.290.13. (Bytes cannot have values higher than 255…) This makes it easier to spot errors.
- It makes IP addresses in three private ranges stand out by giving them a different colour. It supports all three private ranges:
- Loopback addresses (
::1) get a distinguishable colour too. (Thanks to Michael B. Lyons).
- It indexes the hosts so you can use
Goto Symbolto quickly go there. (Made by Michael Blyons)
Credit where credit’s due:
David M. Syzdek wrote the regular expressions for matching IP-addresses that I adapted for this plugin.
The mysterious Michael B. Lyons provided several pull requests with a range of features and fixes. In fact, he added so much that you can consider it to be a complete rewrite of the code we started with.