feat: initial release
This commit is contained in:
17 files changed
+306
No files matched your search
@@ -0,0 +1,18 @@
|
||||
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
|
||||
Reference in new issue
Block a user