Skip to content

georgeharker/tree-sitter-zsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tree-sitter-zsh

CI discord matrix crates npm pypi

Zsh grammar for tree-sitter.

Note

this is not the same as tree-sitter/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

    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:

npm install

Build and run the tests:

npm run build
npm run test

Run the build and tests in watch mode:

npm run test:watch

References