Neovim Treesitter integration for the Huff language
huff.nvim is a lightweight Neovim plugin that brings Treesitter-powered syntax highlighting and indentation support for the Huff low-level EVM language.
- 🧩 Treesitter-powered parsing — accurate syntax highlighting
- 📜 Huff language support — adds
.hufffiletpye and registers in nvim-treesitter - 🔍 Opcode lookup — hover over opcodes to see descriptions, inputs, and outputs
- 🛠️ Simple setup - no extra configuration needed tree-sitter-huff is auto installed
- ⚡️ Huff Neo - Supports Huff Neo compiler buildins
Using lazy.nvim:
return {
"mmsaki/huff.nvim",
version = "0.2.*",
dependencies = { "nvim-treesitter/nvim-treesitter" },
opts = {
window_type = "floating", -- "floating" or "split"
},
}The plugin can be configured with the following options:
| Option | Type | Default | Description |
|---|---|---|---|
window_type |
string | "floating" |
Display mode for opcode information: "floating" for floating window or "split" for horizontal split at top |
| Command | Description |
|---|---|
:TSInstall huff |
Installs the Huff parser |
:TSUpdateSync huff |
Updates huff parsers |
:OpcodeInfo [opcode] |
Look up EVM opcode |
| shift → k | Opcode Lookup |
Supports all EVM opcodes including arithmetic, comparison, bitwise, memory, storage, and control flow operations.
While there are other Huff plugins available, huff.nvim offers several advantages:
| Feature | huff.nvim | wuwe1/vim-huff | pedrommaiaa/vim-huff |
|---|---|---|---|
| Syntax Highlighting | ✓ | ✓ | ✓ |
| Indentation | ✓ | ✓ | ✓ |
| Opcode Lookup | ✓ | ✓ | x |
| Grammar Parsing | ✓ | x | x |
| TreeSitter Support | ✓ | x | x |
Thanks for wuwe1's plugin for inspiring the opcodes lookup feature
Contributions are welcome! If you’d like to improve the parser, fix bugs, or add features, open an issue or submit a PR.