Fix listing of files outside root

This commit is contained in:
Marcelo Jacobus 2024-11-18 10:38:17 -03:00
parent e84c8948c5
commit f49ff03773
2 changed files with 27 additions and 0 deletions

14
lua/plugins/project.lua Normal file
View file

@ -0,0 +1,14 @@
-- lua/plugins/project.lua
return {
{
"ahmedkhalf/project.nvim",
config = function()
require("project_nvim").setup({
detection_methods = { "pattern" },
patterns = { ".git", "Gemfile", "package.json" }, -- Adjust for your project
sync_root_with_cwd = true, -- Ensure working directory syncs with root
})
require("telescope").load_extension("projects")
end,
},
}

13
lua/plugins/telescope.lua Normal file
View file

@ -0,0 +1,13 @@
-- lua/plugins/telescope.lua
-- https://www.lazyvim.org/extras/editor/telescope
return {
"nvim-telescope/telescope.nvim",
opts = function(_, opts)
opts.keys = opts.keys or {}
opts.keys["<Space><Space>"] = function()
require("telescope.builtin").find_files({
cwd = require("project_nvim.project").get_project_root() or vim.fn.getcwd(),
})
end
end,
}