From 795f639ac50d6b8400c1d5868fca54844d579f37 Mon Sep 17 00:00:00 2001 From: Jason Kwok <35944715+Pandoks@users.noreply.github.com> Date: Sat, 14 Oct 2023 03:22:01 -0400 Subject: [PATCH] feat(mini.indentscope): add scope color (#592) * Color change indentline * Options for indentscope * Updated README * Updated vim.yml documentation * Updated types * logic inside of initialization Co-authored-by: mrtnvgr * simplify mini options Co-authored-by: mrtnvgr --------- Co-authored-by: mrtnvgr --- README.md | 15 ++++++++++++--- lua/catppuccin/groups/integrations/mini.lua | 3 ++- lua/catppuccin/types.lua | 7 ++++++- vim.yml | 7 +++++++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 43ca5eda..68fd3725 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,10 @@ require("catppuccin").setup({ nvimtree = true, treesitter = true, notify = false, - mini = false, + mini = { + enabled = true, + indentscope_color = "", + }, -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) }, }) @@ -240,7 +243,10 @@ require("catppuccin").setup({ nvimtree = true, treesitter = true, notify = false, - mini = false, + mini = { + enabled = true, + indentscope_color = "", + }, } }) ``` @@ -819,7 +825,10 @@ mason = false ```lua -mini = false +mini = { + enabled = true, + indentscope_color = "", -- catppuccin color (eg. `lavender`) Default: text +}, ``` diff --git a/lua/catppuccin/groups/integrations/mini.lua b/lua/catppuccin/groups/integrations/mini.lua index 0d6785e9..e5fcbbc9 100644 --- a/lua/catppuccin/groups/integrations/mini.lua +++ b/lua/catppuccin/groups/integrations/mini.lua @@ -6,13 +6,14 @@ function M.get() local inactive_bg = transparent_background and "NONE" or C.mantle + local indentscope_color = O.integrations.mini.indentscope_color return { MiniCompletionActiveParameter = { style = { "underline" } }, MiniCursorword = { style = { "underline" } }, MiniCursorwordCurrent = { style = { "underline" } }, - MiniIndentscopeSymbol = { fg = C.text }, + MiniIndentscopeSymbol = { fg = C[indentscope_color] and C[indentscope_color] or C.text }, MiniIndentscopePrefix = { style = { "nocombine" } }, -- Make it invisible MiniJump = { fg = C.overlay2, bg = C.pink }, diff --git a/lua/catppuccin/types.lua b/lua/catppuccin/types.lua index 01079776..926c5e49 100644 --- a/lua/catppuccin/types.lua +++ b/lua/catppuccin/types.lua @@ -164,7 +164,6 @@ ---@field lsp_trouble boolean? ---@field markdown boolean? ---@field mason boolean? ----@field mini boolean? ---@field native_lsp CtpIntegrationNativeLsp | boolean? -- You **NEED** to enable highlight in your `nvim-navic` config or it won't work: -- @@ -228,6 +227,12 @@ -- Follow the instructions on the plugins GitHub repo to set it up. ---@field colored_indent_levels boolean? +---@class CtpIntegrationMini +-- Whether to enable the integration. +---@field enabled boolean +-- Sets the color of the scope line +---@field indentscope_color CtpColor? + ---@class CtpIntegrationNativeLsp -- Whether to enable the Native LSP integration. ---@field enabled boolean diff --git a/vim.yml b/vim.yml index 7365f992..f6b4b863 100644 --- a/vim.yml +++ b/vim.yml @@ -285,6 +285,13 @@ globals: type: bool property: read-only + O.integrations.mini.enabled: + type: bool + property: read-only + O.integrations.mini.indentscope_color: + type: string + property: read-only + O.integrations.native_lsp.enabled: type: bool property: read-only