Files
tiny-rooter.nvim/README.md
T
swaits ede7b930d5
CI / lint (push) Canceled after 0s
CI / test (push) Canceled after 0s
chore: repoint remaining links at git.swaits.com
Rewrites lingering github.com / *.sr.ht references to this Gitea instance,
translating GitHub and Sourcehut URL shapes to Gitea's (/blob/<ref>/ and
sr.ht /tree/<ref>/item/ -> /src/branch/<ref>/, /tree/<tag> -> /src/tag/<tag>,
/actions/workflows/X -> /actions?workflow=X, /edit/ -> /_edit/).

Left pointing at the old hosts on purpose: pull-request links (PRs were not
migrated), forks that were never migrated, and GitHub-only surfaces Gitea
lacks. OpenPGP identity proofs are untouched by design.
2026-08-31 18:32:32 -06:00

63 lines
1.4 KiB
Markdown

# tiny-rooter.nvim
A tiny project root detector for Neovim 0.12+. Automatically sets the
local working directory to the project root when opening a file.
Zero config. ~15 lines of Lua.
## Features
- Auto-detects project root via marker files
- Sets local working directory (`lcd`) per window
- Ships with a comprehensive default marker list
- Configurable markers for custom project structures
- Works out of the box — no setup call required
## Requirements
- Neovim >= 0.12
## Installation
Add to your `vim.pack.add()` call:
```lua
"https://git.swaits.com/swaits/tiny-rooter.nvim",
```
Done. The plugin auto-loads with sensible defaults.
## Configuration
All options are optional. Call `setup()` only if you want to customize:
```lua
require("tiny-rooter").setup({
markers = { ".git", ".jj", "Cargo.toml", "pyproject.toml", "Makefile", "go.mod", "package.json" },
})
```
## Default markers
The default marker list covers most common project types:
| Marker | Ecosystem |
|--------|-----------|
| `.git` | Git repositories |
| `.jj` | Jujutsu repositories |
| `Cargo.toml` | Rust |
| `pyproject.toml` | Python |
| `Makefile` | C/C++ and general |
| `go.mod` | Go |
| `package.json` | Node.js |
## How it works
On `BufReadPost` and `BufNewFile`, the plugin calls `vim.fs.root()` with
the configured markers. If a root is found, it runs `lcd` to set the
window-local working directory.
## License
[MIT](LICENSE)