This extension adds support for Web3 development in the Zed editor, with primary focus on:
- Solidity language support
- Hardhat framework integration
- Foundry framework integration
- Syntax highlighting for Solidity (.sol) files
- Code navigation
- Smart code completion
- Auto-indentation
- Bracket matching
- Code outline/structure view
- Vim textobjects support
- Automatic detection of Hardhat projects
- Language server integration with hardhat-language-server
- Recognition of hardhat.config.js and hardhat.config.ts files
- Automatic detection of Foundry projects
- Language server integration with nomicfoundation-solidity-language-server
- Recognition of foundry.toml configuration files
- Open Zed
- Open the extensions view (Cmd+Shift+E or Ctrl+Shift+E)
- Search for "Web3"
- Click "Install"
- Clone this repository
git clone https://github.com/your-username/web3-zed.git- Open Zed
- Open the extensions view (Cmd+Shift+E or Ctrl+Shift+E)
- Click "Install Dev Extension"
- Select the cloned repository directory
To fully utilize this extension, you should have:
- Node.js and npm installed for running the language servers
- For Hardhat projects: Install hardhat in your project (
npm install --save-dev hardhat) - For Foundry projects: Install Foundry according to the official documentation
This extension will automatically:
- Detect if your project is a Hardhat project (by checking for hardhat.config.js or hardhat.config.ts)
- Detect if your project is a Foundry project (by checking for foundry.toml)
- Use the appropriate language server based on the detected framework
If neither is detected, it will default to the Nomicfoundation Solidity Language Server.
The snippets/solidity.json file provides intelligent code templates for faster Solidity development with Foundry/Hardhat integration. Trigger these with prefix commands in Zed.
| Prefix | Description | Use Case |
|---|---|---|
erc20 |
Complete ERC20 token implementation | Token contracts |
nonreentrant |
Reentrancy protection wrapper | Secure function patterns |
modifier |
Access control modifier | Owner/role restrictions |
error |
Custom error definition | Gas-efficient reverts |
| Prefix | Description | Framework |
|---|---|---|
foundry-test |
Foundry test contract with setup | Unit/Integration tests |
fuzz |
Fuzz testing template | Property-based testing |
| Prefix | Description | Output Example |
|---|---|---|
natspec |
Complete NatSpec documentation | @dev technical notes |
safecheck |
Input validation with custom error | if (x==0) revert Error() |
event |
Event definition + emission | emit Transfer(...) |
| Prefix | Description | Framework |
|---|---|---|
hh-deploy |
Hardhat deployment script | Scripts/deploy.js |
- Framework-aware: Dedicated snippets for Foundry/Hardhat workflows
- Security-first: Auto-includes best practices (reentrancy guards, input validation)
- Interactive placeholders: Tab through fields with intelligent defaults
- Documentation-ready: NatSpec templates with all standard tags
Usage: Type any prefix in Zed editor and press Tab to expand.
MIT