{"id":13484389,"url":"https://github.com/nvim-treesitter/nvim-treesitter-refactor","last_synced_at":"2025-04-09T05:12:23.849Z","repository":{"id":38472392,"uuid":"295805287","full_name":"nvim-treesitter/nvim-treesitter-refactor","owner":"nvim-treesitter","description":"Refactor module for nvim-treesitter","archived":false,"fork":false,"pushed_at":"2024-09-14T11:21:57.000Z","size":41,"stargazers_count":396,"open_issues_count":17,"forks_count":25,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-29T11:01:16.646Z","etag":null,"topics":["hacktoberfest","nvim-treesitter"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvim-treesitter.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-15T17:44:16.000Z","updated_at":"2024-10-29T02:44:32.000Z","dependencies_parsed_at":"2023-02-10T15:15:17.047Z","dependency_job_id":"3e94e645-03f6-441b-a864-175bb1aea408","html_url":"https://github.com/nvim-treesitter/nvim-treesitter-refactor","commit_stats":{"total_commits":28,"total_committers":12,"mean_commits":"2.3333333333333335","dds":0.8214285714285714,"last_synced_commit":"d8b74fa87afc6a1e97b18da23e762efb032dc270"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":"nvim-treesitter/module-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fnvim-treesitter-refactor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fnvim-treesitter-refactor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fnvim-treesitter-refactor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fnvim-treesitter-refactor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvim-treesitter","download_url":"https://codeload.github.com/nvim-treesitter/nvim-treesitter-refactor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246574857,"owners_count":20799221,"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":["hacktoberfest","nvim-treesitter"],"created_at":"2024-07-31T17:01:23.511Z","updated_at":"2025-04-02T04:05:13.445Z","avatar_url":"https://github.com/nvim-treesitter.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# nvim-treesitter-refactor\n\nRefactor modules for [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)\n\n## Installation\n\nYou can install `nvim-treesitter-refactor` with your favorite package manager,\nor using the default `pack` feature of Neovim!\n\nNote: This plugin requires [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) installed.\n\n### Using a package manager\n\nIf you are using [vim-plug](https://github.com/junegunn/vim-plug), put this in your `init.vim` file:\n\n```vim\nPlug 'nvim-treesitter/nvim-treesitter-refactor'\n```\n\n## Highlight definitions\n\nHighlights definition and usages of the current symbol under the cursor.\n\n```lua\nlua \u003c\u003cEOF\nrequire'nvim-treesitter.configs'.setup {\n  refactor = {\n    highlight_definitions = {\n      enable = true,\n      -- Set to false if you have an `updatetime` of ~100.\n      clear_on_cursor_move = true,\n    },\n  },\n}\nEOF\n```\n\n## Highlight current scope\n\nHighlights the block from the current scope where the cursor is.\n\n```lua\nlua \u003c\u003cEOF\nrequire'nvim-treesitter.configs'.setup {\n  refactor = {\n    highlight_current_scope = { enable = true },\n  },\n}\nEOF\n```\n\n## Smart rename\n\nRenames the symbol under the cursor within the current scope (and current file).\n\n```lua\nlua \u003c\u003cEOF\nrequire'nvim-treesitter.configs'.setup {\n  refactor = {\n    smart_rename = {\n      enable = true,\n      -- Assign keymaps to false to disable them, e.g. `smart_rename = false`.\n      keymaps = {\n        smart_rename = \"grr\",\n      },\n    },\n  },\n}\nEOF\n```\n\n## Navigation\n\nProvides \"go to definition\" for the symbol under the cursor,\nand lists the definitions from the current file. If you use\n`goto_definition_lsp_fallback` instead of `goto_definition` in the config below\n`vim.lsp.buf.definition` is used if nvim-treesitter can not resolve the variable.\n`goto_next_usage`/`goto_previous_usage` go to the next usage of the identifier under the cursor.\n\n\n```lua\nlua \u003c\u003cEOF\nrequire'nvim-treesitter.configs'.setup {\n  refactor = {\n    navigation = {\n      enable = true,\n      -- Assign keymaps to false to disable them, e.g. `goto_definition = false`.\n      keymaps = {\n        goto_definition = \"gnd\",\n        list_definitions = \"gnD\",\n        list_definitions_toc = \"gO\",\n        goto_next_usage = \"\u003ca-*\u003e\",\n        goto_previous_usage = \"\u003ca-#\u003e\",\n      },\n    },\n  },\n}\nEOF\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-treesitter%2Fnvim-treesitter-refactor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvim-treesitter%2Fnvim-treesitter-refactor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-treesitter%2Fnvim-treesitter-refactor/lists"}