Hosts
Syntax highlighting for /etc/hosts files
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for Hosts. The extension's id is hosts.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
zed-hosts
Syntax highlighting for /etc/hosts files in the Zed editor.
Highlights:
- Full-line and inline
#comments - IPv4 and IPv6 addresses (as numbers)
- Hostnames (as variables)
The grammar lives in a sibling repository: tree-sitter-hosts.
Installation
From the Zed extensions panel
Once published: open the command palette → zed: extensions → search for Hosts → Install.
As a dev extension
- Clone this repository.
- In Zed, open the command palette →
zed: install dev extension. - Select the cloned
zed-hosts/directory.
Zed will fetch the grammar from tree-sitter-hosts at the pinned revision and compile it.
File matching
path_suffixes = ["hosts"] (defined in languages/hosts/config.toml) already matches any path ending in hosts, including /etc/hosts and /private/etc/hosts. No extra configuration is needed for the standard case.
If you want to apply the language to other filenames (e.g. Hostfile, hosts.bak, custom paths), add a file_types override to ~/.config/zed/settings.json:
{
"file_types": {
"Hosts": ["Hostfile", "**/custom/path/hosts.*"]
}
}
License
MIT — see LICENSE.