A Neovim plugin that automatically applies colorschemes based on project-specific configuration files.
- 🎨 Automatically detect and apply project-specific colorschemes
- 📁 Supports multiple config file formats (
.nvimrc.lua,.nvim.lua, etc.) - 🔍 Smart project root detection
- ⚙️ Configurable default colorscheme
- 💫 Commands to create and manage project configs
Using lazy.nvim:
{
"ali-aref/project-based-colorscheme.nvim",
config = function()
require("project-based-colorscheme").setup({
default_colorscheme = "catppuccin-mocha", -- Your default colorscheme
})
end,
}Using packer.nvim:
use {
"ali-aref/project-based-colorscheme.nvim",
config = function()
require("project-based-colorscheme").setup({
default_colorscheme = "catppuccin-mocha",
})
end,
}require("project-based-colorscheme").setup({
default_colorscheme = "catppuccin-mocha", -- Default colorscheme to use
config_files = { -- Files to look for in project root
".nvimrc.lua",
".nvim.lua",
"nvim-config.lua",
".vimrc.lua"
},
project_root_indicators = { -- Files/dirs that indicate project root
".git",
"package.json",
"Cargo.toml",
"go.mod",
"pyproject.toml",
"requirements.txt",
"Makefile",
"CMakeLists.txt",
".project-root"
},
})Create a .nvimrc.lua (or any of the supported config file names) in your project root:
-- .nvimrc.lua
return {
colorscheme = "gruvbox-material"
}The plugin will automatically detect and apply this colorscheme when you open files in that project.
Set a colorscheme for the current project. This will create a .nvimrc.lua file in the project root.
:ProjectColorscheme gruvbox-materialShow information about the current project, including the configured colorscheme.
:ProjectInfo- When Neovim starts or you change directories, the plugin detects the project root by looking for common indicators (
.git,package.json, etc.) - It then searches for configuration files (
.nvimrc.lua,.nvim.lua, etc.) in the project root - If a config file is found with a
colorschemefield, it applies that colorscheme - If no project config is found, it falls back to the default colorscheme
MIT