{"id":13897640,"url":"https://github.com/MunifTanjim/nvim-treesitter-lua","last_synced_at":"2025-07-17T14:32:26.258Z","repository":{"id":46018664,"uuid":"392057067","full_name":"MunifTanjim/nvim-treesitter-lua","owner":"MunifTanjim","description":"Tree-sitter Lua parser integration for nvim-treesitter.","archived":true,"fork":false,"pushed_at":"2022-01-19T15:16:44.000Z","size":14,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-25T03:32:52.991Z","etag":null,"topics":["lua","neovim","treesitter"],"latest_commit_sha":null,"homepage":"","language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MunifTanjim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-02T18:38:52.000Z","updated_at":"2024-07-01T06:09:24.000Z","dependencies_parsed_at":"2022-09-02T18:00:32.206Z","dependency_job_id":null,"html_url":"https://github.com/MunifTanjim/nvim-treesitter-lua","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MunifTanjim/nvim-treesitter-lua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MunifTanjim%2Fnvim-treesitter-lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MunifTanjim%2Fnvim-treesitter-lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MunifTanjim%2Fnvim-treesitter-lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MunifTanjim%2Fnvim-treesitter-lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MunifTanjim","download_url":"https://codeload.github.com/MunifTanjim/nvim-treesitter-lua/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MunifTanjim%2Fnvim-treesitter-lua/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265616816,"owners_count":23798903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","neovim","treesitter"],"created_at":"2024-08-06T18:03:46.501Z","updated_at":"2025-07-17T14:32:25.962Z","avatar_url":"https://github.com/MunifTanjim.png","language":"Scheme","funding_links":[],"categories":["Scheme"],"sub_categories":[],"readme":"# nvim-treesitter-lua\n\nLua parser: [`MunifTanjim/tree-sitter-lua`](https://github.com/MunifTanjim/tree-sitter-lua).\n\n_**This repository is now archived. Everything is merged into [`nvim-treesitter/nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter).**_\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\nArchived Documentation\n\u003c/summary\u003e\n\nTree-sitter Lua parser integration for [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter).\n\n## Installation\n\nInstall the plugins with your preferred plugin manager. For example, with\n[`vim-plug`](https://github.com/junegunn/vim-plug):\n\n```vim\nPlug 'MunifTanjim/nvim-treesitter-lua'\nPlug 'nvim-treesitter/nvim-treesitter'\n```\n\nAnd put this in your config file:\n\n```lua\nrequire(\"nvim-treesitter-lua\").setup()\n```\n\nAfter that you can install the parser using this command:\n\n```vim\n:TSInstall lua\n```\n\n## Tree-sitter Queries\n\nThis Lua parser is different than the default one that comes with\n[`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter).\nSo all the plugin that comes with tree-sitter queries for that default\nparser won't work with this one.\n\nSo, `nvim-treesitter-lua` includes queries for a few plugins in the\n[./queries/lua](https://github.com/MunifTanjim/nvim-treesitter-lua/tree/main/queries/lua)\nfolder:\n\n- [`nvim-treesitter/nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter).\n- [`nvim-treesitter/nvim-treesitter-textobjects`](https://github.com/nvim-treesitter/nvim-treesitter-textobjects).\n- [`RRethy/nvim-treesitter-textsubjects`](https://github.com/RRethy/nvim-treesitter-textsubjects).\n\nIf you want to contribute queries for other plugins, please open a Pull Request.\n\nIt also returns some functions you can use to add/remove queries.\n\n### `treesitter_lua.get_query`\n\nReturns the query content for `name`.\n\n**Signature:** `get_query(name: string) -\u003e string`\n\n| Name   | Type     | Description |\n| ------ | -------- | ----------- |\n| `name` | `string` | Query name  |\n\n**Examples:**\n\n```lua\nlocal treesitter_lua = require(\"nvim-treesitter-lua\")\n\ntreesitter_lua.get_query('injections')\n```\n\n### `treesitter_lua.set_query`\n\nSets (append/prepend/replace) the query content for `name` and returns it.\n\n**Signature:**\n\n- `set_query(filepath: string, mode?: string) -\u003e string`\n- `set_query(name: string, content: string, mode?: string) -\u003e string`\n\n| Name       | Type                                               | Description                 |\n| ---------- | -------------------------------------------------- | --------------------------- |\n| `filepath` | `string`                                           | Absolute path to query file |\n| `name`     | `string`                                           | Query name                  |\n| `content`  | `string`                                           | Query content               |\n| `mode`     | `\"append\"` _(default)_ / `\"prepend\"` / `\"replace\"` | Mode for `set_query`        |\n\n**Examples:**\n\n```lua\nlocal treesitter_lua = require(\"nvim-treesitter-lua\")\n\n-- using filepath\ntreesitter_lua.set_query(\"/absolute/path/to/queries/lua/indent.scm\", \"replace\")\n\n-- using name and content\ntreesitter_lua.set_query(\"injections\", [[\n((function_call\n  name: (_) @_nvim_exec\n  arguments: (arguments (string content: _ @vim)))\n  (#match? @_nvim_exec \"(^|\\.)nvim_exec$\"))\n]], \"append\")\n```\n\u003c/details\u003e\n\n## License\n\nLicensed under the MIT License. Check the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMunifTanjim%2Fnvim-treesitter-lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMunifTanjim%2Fnvim-treesitter-lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMunifTanjim%2Fnvim-treesitter-lua/lists"}