From b9225d59149aceb3886474b3410c43c8036c3a6a Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Wed, 25 Aug 2021 09:35:32 -0400 Subject: [PATCH 01/10] add option to show root folder --- .../core/integrations/nvimtree.lua | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/lua/catppuccino/core/integrations/nvimtree.lua b/lua/catppuccino/core/integrations/nvimtree.lua index 06d8c0b..7ed7be8 100644 --- a/lua/catppuccino/core/integrations/nvimtree.lua +++ b/lua/catppuccino/core/integrations/nvimtree.lua @@ -1,24 +1,34 @@ local M = {} function M.get(cpt) - return { - NvimTreeFolderName = {fg = cpt.blue}, - NvimTreeFolderIcon = {fg = cpt.blue}, - NvimTreeNormal = {fg = cpt.fg, bg = cpt.bg_sidebar}, - NvimTreeOpenedFolderName = {fg = cpt.blue}, - NvimTreeEmptyFolderName = {fg = cpt.blue_br}, - NvimTreeIndentMarker = {fg = cpt.comment}, - NvimTreeVertSplit = {fg = cpt.black, bg = cpt.black}, - NvimTreeRootFolder = {fg = cpt.black, style = "bold"}, - NvimTreeSymlink = {fg = cpt.magenta}, - NvimTreeStatuslineNc = {fg = cpt.black, bg = cpt.black}, - NvimTreeGitDirty = {fg = cpt.git.change}, - NvimTreeGitNew = {fg = cpt.git.add}, - NvimTreeGitDeleted = {fg = cpt.git.delete}, - NvimTreeSpecialFile = {fg = cpt.cyan}, - NvimTreeImageFile = {fg = cpt.fg_sidebar}, - NvimTreeOpenedFile = {fg = cpt.magenta} - } + local config = require("catppuccino.config").options + local rootFolderColor = cpt.black + if + config.integrations + and config.integrations.nvimtree + and type(config.integrations.nvimtree) == "table" + and config.integrations.nvimtree.show_root + then + rootFolderColor = cpt.blue + end + return { + NvimTreeFolderName = { fg = cpt.blue }, + NvimTreeFolderIcon = { fg = cpt.blue }, + NvimTreeNormal = { fg = cpt.fg, bg = cpt.bg_sidebar }, + NvimTreeOpenedFolderName = { fg = cpt.blue }, + NvimTreeEmptyFolderName = { fg = cpt.blue_br }, + NvimTreeIndentMarker = { fg = cpt.comment }, + NvimTreeVertSplit = { fg = cpt.black, bg = cpt.black }, + NvimTreeRootFolder = { fg = rootFolderColor, style = "bold" }, + NvimTreeSymlink = { fg = cpt.magenta }, + NvimTreeStatuslineNc = { fg = cpt.black, bg = cpt.black }, + NvimTreeGitDirty = { fg = cpt.git.change }, + NvimTreeGitNew = { fg = cpt.git.add }, + NvimTreeGitDeleted = { fg = cpt.git.delete }, + NvimTreeSpecialFile = { fg = cpt.cyan }, + NvimTreeImageFile = { fg = cpt.fg_sidebar }, + NvimTreeOpenedFile = { fg = cpt.magenta }, + } end return M From 2616c1dac490a35092a1cd92bcc173548bc920c5 Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Wed, 25 Aug 2021 09:37:17 -0400 Subject: [PATCH 02/10] remove autoformatting that conflicts with project formatting --- .../core/integrations/nvimtree.lua | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lua/catppuccino/core/integrations/nvimtree.lua b/lua/catppuccino/core/integrations/nvimtree.lua index 7ed7be8..e676ae1 100644 --- a/lua/catppuccino/core/integrations/nvimtree.lua +++ b/lua/catppuccino/core/integrations/nvimtree.lua @@ -12,22 +12,22 @@ function M.get(cpt) rootFolderColor = cpt.blue end return { - NvimTreeFolderName = { fg = cpt.blue }, - NvimTreeFolderIcon = { fg = cpt.blue }, - NvimTreeNormal = { fg = cpt.fg, bg = cpt.bg_sidebar }, - NvimTreeOpenedFolderName = { fg = cpt.blue }, - NvimTreeEmptyFolderName = { fg = cpt.blue_br }, - NvimTreeIndentMarker = { fg = cpt.comment }, - NvimTreeVertSplit = { fg = cpt.black, bg = cpt.black }, - NvimTreeRootFolder = { fg = rootFolderColor, style = "bold" }, - NvimTreeSymlink = { fg = cpt.magenta }, - NvimTreeStatuslineNc = { fg = cpt.black, bg = cpt.black }, - NvimTreeGitDirty = { fg = cpt.git.change }, - NvimTreeGitNew = { fg = cpt.git.add }, - NvimTreeGitDeleted = { fg = cpt.git.delete }, - NvimTreeSpecialFile = { fg = cpt.cyan }, - NvimTreeImageFile = { fg = cpt.fg_sidebar }, - NvimTreeOpenedFile = { fg = cpt.magenta }, + NvimTreeFolderName = {fg = cpt.blue}, + NvimTreeFolderIcon = {fg = cpt.blue}, + NvimTreeNormal = {fg = cpt.fg, bg = cpt.bg_sidebar}, + NvimTreeOpenedFolderName = {fg = cpt.blue}, + NvimTreeEmptyFolderName = {fg = cpt.blue_br}, + NvimTreeIndentMarker = {fg = cpt.comment}, + NvimTreeVertSplit = {fg = cpt.black, bg = cpt.black}, + NvimTreeRootFolder = {fg = rootFolderColor, style = "bold"}, + NvimTreeSymlink = {fg = cpt.magenta}, + NvimTreeStatuslineNc = {fg = cpt.black, bg = cpt.black}, + NvimTreeGitDirty = {fg = cpt.git.change}, + NvimTreeGitNew = {fg = cpt.git.add}, + NvimTreeGitDeleted = {fg = cpt.git.delete}, + NvimTreeSpecialFile = {fg = cpt.cyan}, + NvimTreeImageFile = {fg = cpt.fg_sidebar}, + NvimTreeOpenedFile = {fg = cpt.magenta}, } end From a1a4212d900eadbb8c12830d4ffc712a96797bdd Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Wed, 25 Aug 2021 09:41:01 -0400 Subject: [PATCH 03/10] reformat file --- .../core/integrations/nvimtree.lua | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/lua/catppuccino/core/integrations/nvimtree.lua b/lua/catppuccino/core/integrations/nvimtree.lua index e676ae1..c686dcb 100644 --- a/lua/catppuccino/core/integrations/nvimtree.lua +++ b/lua/catppuccino/core/integrations/nvimtree.lua @@ -1,34 +1,34 @@ local M = {} function M.get(cpt) - local config = require("catppuccino.config").options - local rootFolderColor = cpt.black - if - config.integrations - and config.integrations.nvimtree - and type(config.integrations.nvimtree) == "table" - and config.integrations.nvimtree.show_root - then - rootFolderColor = cpt.blue - end - return { - NvimTreeFolderName = {fg = cpt.blue}, - NvimTreeFolderIcon = {fg = cpt.blue}, - NvimTreeNormal = {fg = cpt.fg, bg = cpt.bg_sidebar}, - NvimTreeOpenedFolderName = {fg = cpt.blue}, - NvimTreeEmptyFolderName = {fg = cpt.blue_br}, - NvimTreeIndentMarker = {fg = cpt.comment}, - NvimTreeVertSplit = {fg = cpt.black, bg = cpt.black}, - NvimTreeRootFolder = {fg = rootFolderColor, style = "bold"}, - NvimTreeSymlink = {fg = cpt.magenta}, - NvimTreeStatuslineNc = {fg = cpt.black, bg = cpt.black}, - NvimTreeGitDirty = {fg = cpt.git.change}, - NvimTreeGitNew = {fg = cpt.git.add}, - NvimTreeGitDeleted = {fg = cpt.git.delete}, - NvimTreeSpecialFile = {fg = cpt.cyan}, - NvimTreeImageFile = {fg = cpt.fg_sidebar}, - NvimTreeOpenedFile = {fg = cpt.magenta}, - } + local config = require("catppuccino.config").options + local rootFolderColor = cpt.black + if + config.integrations + and config.integrations.nvimtree + and type(config.integrations.nvimtree) == "table" + and config.integrations.nvimtree.show_root + then + rootFolderColor = cpt.blue + end + return { + NvimTreeFolderName = {fg = cpt.blue}, + NvimTreeFolderIcon = {fg = cpt.blue}, + NvimTreeNormal = {fg = cpt.fg, bg = cpt.bg_sidebar}, + NvimTreeOpenedFolderName = {fg = cpt.blue}, + NvimTreeEmptyFolderName = {fg = cpt.blue_br}, + NvimTreeIndentMarker = {fg = cpt.comment}, + NvimTreeVertSplit = {fg = cpt.black, bg = cpt.black}, + NvimTreeRootFolder = {fg = rootFolderColor, style = "bold"}, + NvimTreeSymlink = {fg = cpt.magenta}, + NvimTreeStatuslineNc = {fg = cpt.black, bg = cpt.black}, + NvimTreeGitDirty = {fg = cpt.git.change}, + NvimTreeGitNew = {fg = cpt.git.add}, + NvimTreeGitDeleted = {fg = cpt.git.delete}, + NvimTreeSpecialFile = {fg = cpt.cyan}, + NvimTreeImageFile = {fg = cpt.fg_sidebar}, + NvimTreeOpenedFile = {fg = cpt.magenta}, + } end return M From 1352941f3c17121335e304d689bf4fbca8e6c8e5 Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Wed, 25 Aug 2021 09:42:43 -0400 Subject: [PATCH 04/10] fix indent format --- .../core/integrations/nvimtree.lua | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/lua/catppuccino/core/integrations/nvimtree.lua b/lua/catppuccino/core/integrations/nvimtree.lua index c686dcb..356b0bc 100644 --- a/lua/catppuccino/core/integrations/nvimtree.lua +++ b/lua/catppuccino/core/integrations/nvimtree.lua @@ -1,34 +1,34 @@ local M = {} function M.get(cpt) - local config = require("catppuccino.config").options - local rootFolderColor = cpt.black - if - config.integrations - and config.integrations.nvimtree - and type(config.integrations.nvimtree) == "table" - and config.integrations.nvimtree.show_root - then - rootFolderColor = cpt.blue - end - return { - NvimTreeFolderName = {fg = cpt.blue}, - NvimTreeFolderIcon = {fg = cpt.blue}, - NvimTreeNormal = {fg = cpt.fg, bg = cpt.bg_sidebar}, - NvimTreeOpenedFolderName = {fg = cpt.blue}, - NvimTreeEmptyFolderName = {fg = cpt.blue_br}, - NvimTreeIndentMarker = {fg = cpt.comment}, - NvimTreeVertSplit = {fg = cpt.black, bg = cpt.black}, - NvimTreeRootFolder = {fg = rootFolderColor, style = "bold"}, - NvimTreeSymlink = {fg = cpt.magenta}, - NvimTreeStatuslineNc = {fg = cpt.black, bg = cpt.black}, - NvimTreeGitDirty = {fg = cpt.git.change}, - NvimTreeGitNew = {fg = cpt.git.add}, - NvimTreeGitDeleted = {fg = cpt.git.delete}, - NvimTreeSpecialFile = {fg = cpt.cyan}, - NvimTreeImageFile = {fg = cpt.fg_sidebar}, - NvimTreeOpenedFile = {fg = cpt.magenta}, - } + local config = require("catppuccino.config").options + local rootFolderColor = cpt.black + if + config.integrations + and config.integrations.nvimtree + and type(config.integrations.nvimtree) == "table" + and config.integrations.nvimtree.show_root + then + rootFolderColor = cpt.blue + end + return { + NvimTreeFolderName = {fg = cpt.blue}, + NvimTreeFolderIcon = {fg = cpt.blue}, + NvimTreeNormal = {fg = cpt.fg, bg = cpt.bg_sidebar}, + NvimTreeOpenedFolderName = {fg = cpt.blue}, + NvimTreeEmptyFolderName = {fg = cpt.blue_br}, + NvimTreeIndentMarker = {fg = cpt.comment}, + NvimTreeVertSplit = {fg = cpt.black, bg = cpt.black}, + NvimTreeRootFolder = {fg = rootFolderColor, style = "bold"}, + NvimTreeSymlink = {fg = cpt.magenta}, + NvimTreeStatuslineNc = {fg = cpt.black, bg = cpt.black}, + NvimTreeGitDirty = {fg = cpt.git.change}, + NvimTreeGitNew = {fg = cpt.git.add}, + NvimTreeGitDeleted = {fg = cpt.git.delete}, + NvimTreeSpecialFile = {fg = cpt.cyan}, + NvimTreeImageFile = {fg = cpt.fg_sidebar}, + NvimTreeOpenedFile = {fg = cpt.magenta}, + } end return M From f7cdbab0b2f32434b4244ca605b5fa241d2a95ac Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Wed, 25 Aug 2021 09:46:46 -0400 Subject: [PATCH 05/10] fix formatting again --- .../core/integrations/nvimtree.lua | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lua/catppuccino/core/integrations/nvimtree.lua b/lua/catppuccino/core/integrations/nvimtree.lua index 356b0bc..b808772 100644 --- a/lua/catppuccino/core/integrations/nvimtree.lua +++ b/lua/catppuccino/core/integrations/nvimtree.lua @@ -11,23 +11,24 @@ function M.get(cpt) then rootFolderColor = cpt.blue end + return { - NvimTreeFolderName = {fg = cpt.blue}, - NvimTreeFolderIcon = {fg = cpt.blue}, - NvimTreeNormal = {fg = cpt.fg, bg = cpt.bg_sidebar}, - NvimTreeOpenedFolderName = {fg = cpt.blue}, - NvimTreeEmptyFolderName = {fg = cpt.blue_br}, - NvimTreeIndentMarker = {fg = cpt.comment}, - NvimTreeVertSplit = {fg = cpt.black, bg = cpt.black}, - NvimTreeRootFolder = {fg = rootFolderColor, style = "bold"}, - NvimTreeSymlink = {fg = cpt.magenta}, - NvimTreeStatuslineNc = {fg = cpt.black, bg = cpt.black}, - NvimTreeGitDirty = {fg = cpt.git.change}, - NvimTreeGitNew = {fg = cpt.git.add}, - NvimTreeGitDeleted = {fg = cpt.git.delete}, - NvimTreeSpecialFile = {fg = cpt.cyan}, - NvimTreeImageFile = {fg = cpt.fg_sidebar}, - NvimTreeOpenedFile = {fg = cpt.magenta}, + NvimTreeFolderName = {fg = cpt.blue}, + NvimTreeFolderIcon = {fg = cpt.blue}, + NvimTreeNormal = {fg = cpt.fg, bg = cpt.bg_sidebar}, + NvimTreeOpenedFolderName = {fg = cpt.blue}, + NvimTreeEmptyFolderName = {fg = cpt.blue_br}, + NvimTreeIndentMarker = {fg = cpt.comment}, + NvimTreeVertSplit = {fg = cpt.black, bg = cpt.black}, + NvimTreeRootFolder = {fg = rootFolderColor, style = "bold"}, + NvimTreeSymlink = {fg = cpt.magenta}, + NvimTreeStatuslineNc = {fg = cpt.black, bg = cpt.black}, + NvimTreeGitDirty = {fg = cpt.git.change}, + NvimTreeGitNew = {fg = cpt.git.add}, + NvimTreeGitDeleted = {fg = cpt.git.delete}, + NvimTreeSpecialFile = {fg = cpt.cyan}, + NvimTreeImageFile = {fg = cpt.fg_sidebar}, + NvimTreeOpenedFile = {fg = cpt.magenta} } end From b2469bf1a8beb14fb10ba860a08cc56e310bfdf5 Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Wed, 25 Aug 2021 10:15:06 -0400 Subject: [PATCH 06/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 26dc7bd..96b14de 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ integrations = { gitgutter = false, gitsigns = false, telescope = false, - nvimtree = false, + nvimtree = false, -- boolean, or { enabled = [true/false], show_root = [true/false] }, show_root makes root folder not transparent which_key = false, indent_blankline = false, dashboard = false, From 991963db86962da9ebe189ab1231a40d3e971283 Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Wed, 25 Aug 2021 10:24:29 -0400 Subject: [PATCH 07/10] update README.md --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 96b14de..9cc50e1 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ integrations = { gitgutter = false, gitsigns = false, telescope = false, - nvimtree = false, -- boolean, or { enabled = [true/false], show_root = [true/false] }, show_root makes root folder not transparent + nvimtree = false, which_key = false, indent_blankline = false, dashboard = false, @@ -346,6 +346,22 @@ require('lualine').setup { let g:lightline = {'colorscheme': 'catppuccino'} ``` +- **nvim-tree:** can be configured in either of the following ways: + +```lua +integrations = { + nvimtree = true +} +``` +```lua +integration = { + nvimtree = { + enabled = true, + show_root = true, -- makes the root folder not transparent + } +} +``` + ## List of colorschemes | Colorschemes | Code Names | From 191726bdaa0a8ba97d83f19dafdc2f27b041e133 Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Wed, 25 Aug 2021 14:48:45 -0400 Subject: [PATCH 08/10] update default config --- lua/catppuccino/config.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, From 0fb0ca6dc0fa03e7d9392a88d4793388045b6861 Mon Sep 17 00:00:00 2001 From: Pocco81 Date: Wed, 25 Aug 2021 21:25:21 -0500 Subject: [PATCH 09/10] fix: formatting (luafmt), naming conventions and assertion --- lua/catppuccino/core/integrations/nvimtree.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lua/catppuccino/core/integrations/nvimtree.lua b/lua/catppuccino/core/integrations/nvimtree.lua index b808772..48e59f7 100644 --- a/lua/catppuccino/core/integrations/nvimtree.lua +++ b/lua/catppuccino/core/integrations/nvimtree.lua @@ -2,14 +2,11 @@ local M = {} function M.get(cpt) local config = require("catppuccino.config").options - local rootFolderColor = cpt.black - if - config.integrations - and config.integrations.nvimtree - and type(config.integrations.nvimtree) == "table" - and config.integrations.nvimtree.show_root - then - rootFolderColor = cpt.blue + + local root_dir_color = cpt.bg_sidebar + + if (config.integrations.nvimtree.show_root) then + root_dir_color = cpt.blue end return { @@ -20,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 = rootFolderColor, 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}, From 6d83b17fe787091e70ee36c7aefa00c4f60e9419 Mon Sep 17 00:00:00 2001 From: Pocco81 Date: Wed, 25 Aug 2021 21:29:29 -0500 Subject: [PATCH 10/10] dev: better doc --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9cc50e1..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,13 +355,8 @@ require('lualine').setup { let g:lightline = {'colorscheme': 'catppuccino'} ``` -- **nvim-tree:** can be configured in either of the following ways: +- **NvimTree:** setting `enabled` to `true` enables this integration: -```lua -integrations = { - nvimtree = true -} -``` ```lua integration = { nvimtree = { @@ -473,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 |