diff --git a/README.md b/README.md index 26dc7bd..de44b1f 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,10 @@ integrations = { gitgutter = false, gitsigns = false, telescope = false, - nvimtree = false, + nvimtree = { + enabled = false, + show_root = false, + }, which_key = false, indent_blankline = false, dashboard = false, @@ -202,7 +205,10 @@ catppuccino.setup( gitgutter = false, gitsigns = false, telescope = false, - nvimtree = false, + nvimtree = { + enabled = false, + show_root = false, + }, which_key = false, indent_blankline = false, dashboard = false, @@ -259,7 +265,10 @@ catppuccino.setup( gitgutter = false, gitsigns = false, telescope = false, - nvimtree = false, + nvimtree = { + enabled = false, + show_root = false, + }, which_key = false, indent_blankline = false, dashboard = false, @@ -346,6 +355,17 @@ require('lualine').setup { let g:lightline = {'colorscheme': 'catppuccino'} ``` +- **NvimTree:** setting `enabled` to `true` enables this integration: + +```lua +integration = { + nvimtree = { + enabled = true, + show_root = true, -- makes the root folder not transparent + } +} +``` + ## List of colorschemes | Colorschemes | Code Names | @@ -457,7 +477,7 @@ diff = { -- also used for gitsigns Use them to execute code at certain events [described by their names]. These are the ones available: | Function | Description | -|--------------------|------------------------------| +| ------------------ | ---------------------------- | | `before_loading()` | Before loading a colorscheme | | `after_loading()` | After loading a colorscheme | diff --git a/lua/catppuccino/config.lua b/lua/catppuccino/config.lua index 4dbb8f9..d729971 100644 --- a/lua/catppuccino/config.lua +++ b/lua/catppuccino/config.lua @@ -27,7 +27,10 @@ config.options = { gitgutter = false, gitsigns = false, telescope = false, - nvimtree = false, + nvimtree = { + enabled = false, + show_root = false, + }, which_key = false, indent_blankline = false, dashboard = false, diff --git a/lua/catppuccino/core/integrations/nvimtree.lua b/lua/catppuccino/core/integrations/nvimtree.lua index 06d8c0b..48e59f7 100644 --- a/lua/catppuccino/core/integrations/nvimtree.lua +++ b/lua/catppuccino/core/integrations/nvimtree.lua @@ -1,6 +1,14 @@ local M = {} function M.get(cpt) + local config = require("catppuccino.config").options + + local root_dir_color = cpt.bg_sidebar + + if (config.integrations.nvimtree.show_root) then + root_dir_color = cpt.blue + end + return { NvimTreeFolderName = {fg = cpt.blue}, NvimTreeFolderIcon = {fg = cpt.blue}, @@ -9,7 +17,7 @@ function M.get(cpt) NvimTreeEmptyFolderName = {fg = cpt.blue_br}, NvimTreeIndentMarker = {fg = cpt.comment}, NvimTreeVertSplit = {fg = cpt.black, bg = cpt.black}, - NvimTreeRootFolder = {fg = cpt.black, style = "bold"}, + NvimTreeRootFolder = {fg = root_dir_color, style = "bold"}, NvimTreeSymlink = {fg = cpt.magenta}, NvimTreeStatuslineNc = {fg = cpt.black, bg = cpt.black}, NvimTreeGitDirty = {fg = cpt.git.change},