{"id":30151797,"url":"https://github.com/hugoh/nvim-rooter","last_synced_at":"2026-05-18T03:35:56.285Z","repository":{"id":308445653,"uuid":"1032849027","full_name":"hugoh/nvim-rooter","owner":"hugoh","description":"Minimalist Neovim plugin that automatically changes your working directory to the project root","archived":false,"fork":false,"pushed_at":"2026-04-08T01:36:02.000Z","size":35,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-08T03:29:01.143Z","etag":null,"topics":["lua","neovim","neovim-plugin","nvim"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/hugoh.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-05T23:40:33.000Z","updated_at":"2026-04-08T01:35:56.000Z","dependencies_parsed_at":"2025-08-06T01:28:43.566Z","dependency_job_id":"454ee584-670d-44e7-b2e8-a178fc77be13","html_url":"https://github.com/hugoh/nvim-rooter","commit_stats":null,"previous_names":["hugoh/nvim-rooter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hugoh/nvim-rooter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoh%2Fnvim-rooter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoh%2Fnvim-rooter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoh%2Fnvim-rooter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoh%2Fnvim-rooter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugoh","download_url":"https://codeload.github.com/hugoh/nvim-rooter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoh%2Fnvim-rooter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33163783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","neovim-plugin","nvim"],"created_at":"2025-08-11T11:03:00.181Z","updated_at":"2026-05-18T03:35:56.280Z","avatar_url":"https://github.com/hugoh.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nvim-rooter 🌳\n\nA minimalist (60 LOC) Neovim plugin that changes your working directory to the project root when opening files:\n\n- Automatic and manual (`Rooter` command) modes\n- Option to be prompted to confirm the directory change\n\n## Installation\n\n### With Lazy.nvim\n\n```lua\n{\n    \"hugoh/nvim-rooter\",\n    opts = {\n        -- Optional custom configuration\n    }\n}\n```\n\n### With Packer.nvim\n\n```lua\nuse {\n    \"your-username/nvim-rooter\",\n    config = function()\n        require(\"nvim-rooter\").setup()\n    end\n}\n```\n\n## Default Configuration\n\n```lua\n{\n\troot_patterns = { \".git\", \"_darcs\", \".hg\", \".bzr\", \".svn\" },\n\tauto = true, -- automatically change working directory on buffer change\n\tconfirm = false, -- confirm before automatically changing directory\n\tdisplay_notification = true,\n}\n```\n\n## Usage\n\nJust open a file:\n\n1. Opens a file in your project\n2. nvim-rooter changes directory to project root if one is found, and displays a notification (optional)\n\n## API\n\n### `require(\"nvim_rooter\").get_root()`\n\nReturns the root directory of the project for the current buffer, or `nil` if no root is found:\n\n```lua\nlocal root = require(\"nvim_rooter\").get_root()\nif root then\n  print(\"Project root: \" .. root)\nend\n```\n\n### `require(\"nvim_rooter\").is_cwd_root()`\n\nChecks if the current working directory is already the project root. Returns a boolean and the root directory:\n\n```lua\nlocal is_root, root = require(\"nvim_rooter\").is_cwd_root()\nif is_root then\n  print(\"Already at project root: \" .. root)\nend\n```\n\n### `require(\"nvim_rooter\").set_root(manual)`\n\nChanges the working directory to the project root. The `manual` parameter (default: `false`) indicates if the change was manually triggered:\n\n- When `manual` is `true`, directory changes are not subject to the `confirm` setting\n- When `manual` is `false` and `confirm` is enabled, the user will be prompted before changing\n\n```lua\nrequire(\"nvim_rooter\").set_root()  -- Auto mode\nrequire(\"nvim_rooter\").set_root(true)  -- Manual mode (via :Rooter command)\n```\n\n## Customization\n\nOverride any defaults in your setup:\n\n```lua\nrequire(\"nvim_rooter\").setup({\n    root_patterns = { \".git\", \"Makefile\" },  -- Custom root markers\n})\n```\n\n## Testing\n\nTo run tests locally:\n\n```bash\nmake test\n```\n\nRequires [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) installed via Lazy.\n\n## Alternatives\n\n- [ahmedkhalf/project.nvim](https://github.com/ahmedkhalf/project.nvim)\n- [DrKJeff16/project.nvim](https://github.com/DrKJeff16/project.nvim)\n- [notjedi/nvim-rooter.lua](https://github.com/notjedi/nvim-rooter.lua)\n- [ygm2/nvim-rooter.lua](https://github.com/ygm2/nvim-rooter.lua)\n- [wsdjeg/rooter.nvim](https://github.com/wsdjeg/rooter.nvim)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugoh%2Fnvim-rooter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugoh%2Fnvim-rooter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugoh%2Fnvim-rooter/lists"}