main
Covers files missed by the first pass (.svelte/.astro components, bare org and profile links, plugin doc headers), plus content that needed rewriting rather than a URL swap: the chezmoi bootstrap script now provisions SSH for git.swaits.com (User git, port 2222) and initialises from Gitea. Link labels were updated to match their new targets.
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:
"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:
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
Description
Change CWD to a project root, with a tiny Neovim plugin
38 KiB
0 Stars
1 Watchers
0 Forks
Languages
Lua
78.6%
Shell
21.4%