mirror of
https://github.com/pnx/tree-sitter-dotenv
synced 2026-06-16 01:54:56 +02:00
No description
Updates the requirements on [tree-sitter](https://github.com/tree-sitter/py-tree-sitter) and [setuptools](https://github.com/pypa/setuptools) to permit the latest version. Updates `tree-sitter` to 0.25.2 - [Release notes](https://github.com/tree-sitter/py-tree-sitter/releases) - [Commits](https://github.com/tree-sitter/py-tree-sitter/compare/v0.24.0...v0.25.2) Updates `setuptools` to 82.0.1 - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v42.0.0...v82.0.1) --- updated-dependencies: - dependency-name: tree-sitter dependency-version: 0.25.2 dependency-type: direct:development dependency-group: pip - dependency-name: setuptools dependency-version: 82.0.1 dependency-type: direct:development dependency-group: pip ... Signed-off-by: dependabot[bot] <support@github.com> |
||
|---|---|---|
| .github | ||
| bindings | ||
| queries | ||
| src | ||
| test/corpus | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .tsqueryrc.json | ||
| binding.gyp | ||
| Cargo.toml | ||
| CMakeLists.txt | ||
| go.mod | ||
| go.sum | ||
| grammar.js | ||
| LICENSE | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| Package.swift | ||
| pyproject.toml | ||
| README.md | ||
| setup.py | ||
| tree-sitter.json | ||
tree-sitter-dotenv
tree-sitter grammar for dotenv
Installation
Neovim
To use this parser in neovim, you need to configure nvim-treesitter
Add this to nvim-treesitter's config function:
config = function(_, opts)
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
-- Tell treesitter where dotenv parser is located
parser_config.dotenv = {
install_info = {
url = "https://github.com/pnx/tree-sitter-dotenv",
branch = "main",
files = { "src/parser.c", "src/scanner.c" },
},
filetype = "dotenv",
}
-- Associate .env files as "dotenv"
vim.filetype.add({
pattern = {
['%.env'] = 'dotenv',
['%.env%..+'] = 'dotenv',
},
})
end
Syntax highlighting
In order for neovim to know how to color the text, a highlights.scm file is needed.
Copy highlights.scm from this repo to your nvim config under queries/dotenv/highlights.scm
Author
Henrik Hautakoski henrik.hautakoski@gmail.com