A simple and efficient file picker for monorepo projects. This plugin finds all directories containing specific file patterns (like package.json or project.json) and provides a telescope.nvim interface to quickly navigate and search within those projects.
- π Project Discovery: Automatically finds project directories based on configurable file patterns
- π File Navigation: Quick file finding within selected projects using telescope.nvim
- π Text Search: Live grep functionality within project directories
- βοΈ Configurable: Customizable file patterns and ignore rules
- π Performance: Efficient directory scanning with ignore patterns
- π Smart Display: Shows parent directory context and project file indicators for better identification
Using lazy.nvim
{
"sajjathossain/nvim-monorepos",
dependencies = {
"nvim-telescope/telescope.nvim"
},
cmd = {
"FindFilesInAProject",
"FindInFilesInAProject"
},
config = true
}{
"sajjathossain/nvim-monorepos",
dependencies = {
"nvim-telescope/telescope.nvim"
},
cmd = {
"FindFilesInAProject",
"FindInFilesInAProject"
},
config = function()
require("nvim-monorepos").setup({
files = { "package.json", "Cargo.toml", "go.mod" },
ignore = { ".git", "node_modules", "target", "build" }
})
end
}| Command | Description |
|---|---|
:FindFilesInAProject |
Open project picker, then find files in selected project |
:FindInFilesInAProject |
Open project picker, then search text in selected project |
local monorepos = require("nvim-monorepos")
-- Find files in a project
monorepos.find_files()
-- Search text in project files
monorepos.find_in_files(){
files = { "project.json", "package.json" },
ignore = { ".git", "node_modules", "build" },
display = {
show_icons = true, -- Show file type icons
show_file_count = false, -- Show file count instead of file names
compact_paths = true -- Use compact path display
}
}| Option | Type | Default | Description |
|---|---|---|---|
files |
string[] |
{"project.json", "package.json"} |
File patterns to identify project root directories |
ignore |
string[] |
{".git", "node_modules", "build"} |
Directory patterns to ignore during scanning |
display.show_icons |
boolean |
true |
Show file type icons (π¦ for package.json, π¦ for Cargo.toml, etc.) |
display.show_file_count |
boolean |
false |
Show file count instead of individual file names |
display.compact_paths |
boolean |
true |
Use compact path display (parent/project format) |
require("nvim-monorepos").setup({
files = { "package.json", "tsconfig.json" },
ignore = { ".git", "node_modules", "dist", ".next" }
})require("nvim-monorepos").setup({
files = { "Cargo.toml" },
ignore = { ".git", "target", "node_modules" }
})require("nvim-monorepos").setup({
files = { "go.mod" },
ignore = { ".git", "vendor", "bin" }
})require("nvim-monorepos").setup({
files = { "package.json", "Cargo.toml", "go.mod", "pom.xml" },
ignore = { ".git", "node_modules", "target", "vendor", "build" }
})require("nvim-monorepos").setup({
files = { "package.json", "Cargo.toml" },
ignore = { ".git", "node_modules", "target" },
display = {
show_icons = true, -- Show icons: frontend/web-app β π¦ package.json β’ π· tsconfig.json
show_file_count = false, -- Or show count: frontend/web-app (2 files)
compact_paths = true -- Use parent/project format for long paths
}
})require("nvim-monorepos").setup({
files = { "package.json" },
display = {
show_icons = false -- Plain format: frontend/web-app [package.json, tsconfig.json]
}
})- Scanning: The plugin recursively scans your current working directory
- Filtering: Directories are filtered based on ignore patterns
- Project Detection: Directories containing any of the specified file patterns are identified as projects
- Selection: Telescope picker shows all found projects for selection
- Action: Selected project opens telescope's file finder or live grep
- telescope.nvim
- Neovim >= 0.7.0
MIT License - see LICENSE file for details.