Files
swaits fb9a52eae8
CI / lint (push) Canceled after 0s
CI / test (push) Canceled after 0s
feat: initial release
2026-04-09 15:40:48 -06:00

19 lines
474 B
Lua

local M = {}
function M.setup(opts)
opts = opts or {}
local markers = opts.markers
or { ".git", ".jj", "Cargo.toml", "pyproject.toml", "Makefile", "go.mod", "package.json" }
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
group = vim.api.nvim_create_augroup("tiny-rooter", { clear = true }),
callback = function()
local root = vim.fs.root(0, markers)
if root then
vim.cmd.lcd(root)
end
end,
})
end
return M