# tree-sitter-zsh
[![CI][ci]](https://github.com/tree-sitter/tree-sitter-zsh/actions/workflows/ci.yml)
[![discord][discord]](https://discord.gg/w7nTvsVJhm)
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
[![crates][crates]](https://crates.io/crates/tree-sitter-zsh)
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-zsh)
[![pypi][pypi]](https://pypi.org/project/tree-sitter-zsh)
Zsh grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
> [!NOTE]
> this is not the same as [tree-sitter/tree-sitter-zsh](https://github.com/tree-sitter-grammars/tree-sitter-zsh)
> which has been archived, but rather a complete reworking starting
> from the bash grammar.
### Known issues:
Glob qualifier delimeters for 's::' and 'n::' and 'b::' must be ':' rather
than arbitrary paired chars.
## Installation
For neovim, add the following to your config
```lua
vim.api.nvim_create_autocmd("User", {
pattern = "TSUpdate",
callback = function()
require("nvim-treesitter.parsers").zsh = {
install_info = {
"https://github.com/georgeharker/tree-sitter-zsh",
generate_from_json = false, -- only needed if repo does not contain `src/grammar.json` either
queries = 'nvim-queries', -- also install queries from given directory
},
tier = 3,
}
end,
})
```
In addition to enabling treesitter for zsh files.
## Development
Install the dependencies:
```sh
npm install
```
Build and run the tests:
```sh
npm run build
npm run test
```
Run the build and tests in watch mode:
```sh
npm run test:watch
```
### References
- [Zsh reference docs](https://zsh.sourceforge.io/Doc/Release/zsh_toc.html)
- [Shell command language specification](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html)
- [mvdnan/sh - a shell parser in go](https://github.com/mvdan/sh)
- [tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash)
[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-zsh/ci.yml?logo=github&label=CI
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
[npm]: https://img.shields.io/npm/v/tree-sitter-zsh?logo=npm
[crates]: https://img.shields.io/crates/v/tree-sitter-zsh?logo=rust
[pypi]: https://img.shields.io/pypi/v/tree-sitter-zsh?logo=pypi&logoColor=ffd242
Raw data
{
"_id": null,
"home_page": null,
"name": "tree-sitter-zsh",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "incremental, parsing, tree-sitter, zsh",
"author": null,
"author_email": "George Harker <georgeharker@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/6f/33/e4daece222d53ddafcbeb8e16cdfb6e6a881e21c854eba9b6cf587412f3f/tree_sitter_zsh-0.35.0.tar.gz",
"platform": null,
"description": "# tree-sitter-zsh\n\n[![CI][ci]](https://github.com/tree-sitter/tree-sitter-zsh/actions/workflows/ci.yml)\n[![discord][discord]](https://discord.gg/w7nTvsVJhm)\n[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)\n[![crates][crates]](https://crates.io/crates/tree-sitter-zsh)\n[![npm][npm]](https://www.npmjs.com/package/tree-sitter-zsh)\n[![pypi][pypi]](https://pypi.org/project/tree-sitter-zsh)\n\nZsh grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).\n\n> [!NOTE]\n> this is not the same as [tree-sitter/tree-sitter-zsh](https://github.com/tree-sitter-grammars/tree-sitter-zsh) \n> which has been archived, but rather a complete reworking starting\n> from the bash grammar.\n\n### Known issues:\n \nGlob qualifier delimeters for 's::' and 'n::' and 'b::' must be ':' rather\nthan arbitrary paired chars.\n\n## Installation\n\nFor neovim, add the following to your config \n\n```lua\n vim.api.nvim_create_autocmd(\"User\", {\n pattern = \"TSUpdate\",\n callback = function()\n require(\"nvim-treesitter.parsers\").zsh = {\n install_info = {\n \"https://github.com/georgeharker/tree-sitter-zsh\",\n generate_from_json = false, -- only needed if repo does not contain `src/grammar.json` either\n queries = 'nvim-queries', -- also install queries from given directory\n },\n tier = 3,\n }\n end,\n })\n\n```\n\nIn addition to enabling treesitter for zsh files.\n\n## Development\n\nInstall the dependencies:\n\n```sh\nnpm install\n```\n\nBuild and run the tests:\n\n```sh\nnpm run build\nnpm run test\n```\n\nRun the build and tests in watch mode:\n\n```sh\nnpm run test:watch\n```\n\n### References\n\n- [Zsh reference docs](https://zsh.sourceforge.io/Doc/Release/zsh_toc.html)\n- [Shell command language specification](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html)\n- [mvdnan/sh - a shell parser in go](https://github.com/mvdan/sh)\n- [tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash)\n\n[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-zsh/ci.yml?logo=github&label=CI\n[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord\n[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix\n[npm]: https://img.shields.io/npm/v/tree-sitter-zsh?logo=npm\n[crates]: https://img.shields.io/crates/v/tree-sitter-zsh?logo=rust\n[pypi]: https://img.shields.io/pypi/v/tree-sitter-zsh?logo=pypi&logoColor=ffd242\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Zsh grammar for tree-sitter",
"version": "0.35.0",
"project_urls": {
"Homepage": "https://github.com/georgeharker/tree-sitter-zsh"
},
"split_keywords": [
"incremental",
" parsing",
" tree-sitter",
" zsh"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2ba719c802886bf12bfa82f6e50fb40b7de3638b64e7b12d12b47229b9941f23",
"md5": "ceacad7814a02a34b2939be7b80a81d8",
"sha256": "db08325c10f73c0cc491cfec469fc90d8d05b3fd57d346ec75b77a1b63051690"
},
"downloads": -1,
"filename": "tree_sitter_zsh-0.35.0-cp310-abi3-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "ceacad7814a02a34b2939be7b80a81d8",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 493345,
"upload_time": "2025-10-29T22:14:50",
"upload_time_iso_8601": "2025-10-29T22:14:50.087298Z",
"url": "https://files.pythonhosted.org/packages/2b/a7/19c802886bf12bfa82f6e50fb40b7de3638b64e7b12d12b47229b9941f23/tree_sitter_zsh-0.35.0-cp310-abi3-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "39695248f5361497781d6308f0409d48ce168ff33504df0d5f3a6c14a820ee55",
"md5": "caca03ea93b0298a24a4191237a6bc41",
"sha256": "ad45a45ee5ab9dc873b0d83ab7798dc02041df6c24069a07be23de3f107a8f06"
},
"downloads": -1,
"filename": "tree_sitter_zsh-0.35.0-cp310-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "caca03ea93b0298a24a4191237a6bc41",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 520027,
"upload_time": "2025-10-29T22:14:51",
"upload_time_iso_8601": "2025-10-29T22:14:51.338218Z",
"url": "https://files.pythonhosted.org/packages/39/69/5248f5361497781d6308f0409d48ce168ff33504df0d5f3a6c14a820ee55/tree_sitter_zsh-0.35.0-cp310-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "551faca939b6cd3aefe3e6225731f0ab8ecd285a25c232bb1af0ae1319edee72",
"md5": "ebe789db2b2ab579f8254c3b900c74eb",
"sha256": "01205c9d2bf9d2910ca77e6b191d5ef6a5f33ce79a4257651bbd6b8b80366424"
},
"downloads": -1,
"filename": "tree_sitter_zsh-0.35.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl",
"has_sig": false,
"md5_digest": "ebe789db2b2ab579f8254c3b900c74eb",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 547700,
"upload_time": "2025-10-29T22:14:52",
"upload_time_iso_8601": "2025-10-29T22:14:52.563263Z",
"url": "https://files.pythonhosted.org/packages/55/1f/aca939b6cd3aefe3e6225731f0ab8ecd285a25c232bb1af0ae1319edee72/tree_sitter_zsh-0.35.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "41ef47ab46ff23e66d93f849f69c430e925001005979466d02c357243e5d47be",
"md5": "9669e01ec5148ecfb3b2bc70a5db8de2",
"sha256": "e1249fbd47d2e4ba8baad19aa66b4c386fd1b0d20217f37e253a915ad6047a48"
},
"downloads": -1,
"filename": "tree_sitter_zsh-0.35.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "9669e01ec5148ecfb3b2bc70a5db8de2",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 548286,
"upload_time": "2025-10-29T22:14:53",
"upload_time_iso_8601": "2025-10-29T22:14:53.671979Z",
"url": "https://files.pythonhosted.org/packages/41/ef/47ab46ff23e66d93f849f69c430e925001005979466d02c357243e5d47be/tree_sitter_zsh-0.35.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0e2266e4835d1f9fb6d9b297e5cb646fbf8ed5899e778c9fb2343d977e0a3c0e",
"md5": "a0d8ccc46f1e65d5fb09abc951dcbc86",
"sha256": "91db46a9328951bf988915a3d6163295ef009994ae0070b31116bba887fd918b"
},
"downloads": -1,
"filename": "tree_sitter_zsh-0.35.0-cp310-abi3-musllinux_1_2_aarch64.whl",
"has_sig": false,
"md5_digest": "a0d8ccc46f1e65d5fb09abc951dcbc86",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 544467,
"upload_time": "2025-10-29T22:14:54",
"upload_time_iso_8601": "2025-10-29T22:14:54.905823Z",
"url": "https://files.pythonhosted.org/packages/0e/22/66e4835d1f9fb6d9b297e5cb646fbf8ed5899e778c9fb2343d977e0a3c0e/tree_sitter_zsh-0.35.0-cp310-abi3-musllinux_1_2_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f88b283945cb29a294a05b60d5ea96c3bdb6a6aae20b2425a304af2affc0b199",
"md5": "b907f2ebf2f87b02ac9cb93ae0272d40",
"sha256": "42bb353edb341f2d86286dc846bc919897ecbb22babfcfe2519156cfc5b827fe"
},
"downloads": -1,
"filename": "tree_sitter_zsh-0.35.0-cp310-abi3-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "b907f2ebf2f87b02ac9cb93ae0272d40",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 544959,
"upload_time": "2025-10-29T22:14:56",
"upload_time_iso_8601": "2025-10-29T22:14:56.246000Z",
"url": "https://files.pythonhosted.org/packages/f8/8b/283945cb29a294a05b60d5ea96c3bdb6a6aae20b2425a304af2affc0b199/tree_sitter_zsh-0.35.0-cp310-abi3-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "90809134bdae1773820308a0ed85ddd7620c5a90f18bb17f2824382941130037",
"md5": "aa161bb84bed614e57cb05144a7c6c83",
"sha256": "28723fbf76addb9e178ca228add5c2d0fdbbf3d2c869e2d051662bb1783eb688"
},
"downloads": -1,
"filename": "tree_sitter_zsh-0.35.0-cp310-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "aa161bb84bed614e57cb05144a7c6c83",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 494710,
"upload_time": "2025-10-29T22:14:57",
"upload_time_iso_8601": "2025-10-29T22:14:57.279987Z",
"url": "https://files.pythonhosted.org/packages/90/80/9134bdae1773820308a0ed85ddd7620c5a90f18bb17f2824382941130037/tree_sitter_zsh-0.35.0-cp310-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "cbd48d2ad2284467a28095e293761f379ed88184dd4f31a2d019e72cb5aed81a",
"md5": "b29900d222d84cdedbe5c8fd5a14f83b",
"sha256": "379928bdd35ba708c01c32475e76e94ff8ef3fd70845e9c19884c726d3a89976"
},
"downloads": -1,
"filename": "tree_sitter_zsh-0.35.0-cp310-abi3-win_arm64.whl",
"has_sig": false,
"md5_digest": "b29900d222d84cdedbe5c8fd5a14f83b",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10",
"size": 487582,
"upload_time": "2025-10-29T22:14:58",
"upload_time_iso_8601": "2025-10-29T22:14:58.473283Z",
"url": "https://files.pythonhosted.org/packages/cb/d4/8d2ad2284467a28095e293761f379ed88184dd4f31a2d019e72cb5aed81a/tree_sitter_zsh-0.35.0-cp310-abi3-win_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6f33e4daece222d53ddafcbeb8e16cdfb6e6a881e21c854eba9b6cf587412f3f",
"md5": "dc52496ab991217984d65cc29d8799c7",
"sha256": "a48b2871376ba8d1b3cbdbd5ed732afcc93a6b668c65024f24ce35ce47b1b1ec"
},
"downloads": -1,
"filename": "tree_sitter_zsh-0.35.0.tar.gz",
"has_sig": false,
"md5_digest": "dc52496ab991217984d65cc29d8799c7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 1217326,
"upload_time": "2025-10-29T22:14:59",
"upload_time_iso_8601": "2025-10-29T22:14:59.595535Z",
"url": "https://files.pythonhosted.org/packages/6f/33/e4daece222d53ddafcbeb8e16cdfb6e6a881e21c854eba9b6cf587412f3f/tree_sitter_zsh-0.35.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-29 22:14:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "georgeharker",
"github_project": "tree-sitter-zsh",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tree-sitter-zsh"
}