Skip to content

Commit

Permalink
feat(indent-blankline): update to v3, add scope color (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandoks authored Sep 29, 2023
1 parent 3d9a5ed commit f04336b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -680,14 +680,15 @@ hop = false
```lua
indent_blankline = {
enabled = true,
scope_color = "", -- catppuccin color (eg. `lavender`) Default: text
colored_indent_levels = false,
},

```

<details> <summary>Special</summary>

`colored_indent_levels` enables char highlights per indent level. Follow the instructions [here](https://github.com/lukas-reineke/indent-blankline.nvim#with-custom-gindent_blankline_char_highlight_list) to set the latter up.
`colored_indent_levels` enables char highlights per indent level. Follow the instructions [here](https://github.com/lukas-reineke/indent-blankline.nvim#multiple-indent-colors) to set the latter up.

</details>

Expand Down
24 changes: 15 additions & 9 deletions lua/catppuccin/groups/integrations/indent_blankline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ local M = {}

function M.get()
local hi = {
IndentBlanklineChar = { fg = C.surface0 },
IndentBlanklineContextChar = { fg = C.text },
IndentBlanklineContextStart = { sp = C.text, style = { "underline" } },
IblIndent = { fg = C.surface0 },
}

local scope_color = O.integrations.indent_blankline.scope_color
if C[scope_color] then
hi["IblScope"] = { fg = C[scope_color] }
else
hi["IblScope"] = { fg = C.text }
end

if O.integrations.indent_blankline.colored_indent_levels then
hi["IndentBlanklineIndent6"] = { blend = 0, fg = C.yellow }
hi["IndentBlanklineIndent5"] = { blend = 0, fg = C.red }
hi["IndentBlanklineIndent4"] = { blend = 0, fg = C.teal }
hi["IndentBlanklineIndent3"] = { blend = 0, fg = C.peach }
hi["IndentBlanklineIndent2"] = { blend = 0, fg = C.blue }
hi["IndentBlanklineIndent1"] = { blend = 0, fg = C.pink }
hi["RainbowRed"] = { blend = 0, fg = C.red }
hi["RainbowYellow"] = { blend = 0, fg = C.yellow }
hi["RainbowBlue"] = { blend = 0, fg = C.blue }
hi["RainbowOrange"] = { blend = 0, fg = C.peach }
hi["RainbowGreen"] = { blend = 0, fg = C.green }
hi["RainbowViolet"] = { blend = 0, fg = C.mauve }
hi["RainbowCyan"] = { blend = 0, fg = C.teal }
end

return hi
Expand Down
1 change: 1 addition & 0 deletions lua/catppuccin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ local M = {
},
indent_blankline = {
enabled = true,
scope_color = "",
colored_indent_levels = false,
},
native_lsp = {
Expand Down
2 changes: 2 additions & 0 deletions lua/catppuccin/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@
---@class CtpIntegrationIndentBlankline
-- Whether to enable the integration.
---@field enabled boolean
-- Sets the color of the scope line
---@field scope_color CtpColor?
-- Enables char highlights per indent level.
-- Follow the instructions on the plugins GitHub repo to set it up.
---@field colored_indent_levels boolean?
Expand Down
3 changes: 3 additions & 0 deletions vim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ globals:
O.integrations.indent_blankline.enabled:
type: bool
property: read-only
O.integrations.indent_blankline.scope_color:
type: string
property: read-only
O.integrations.indent_blankline.colored_indent_levels:
type: bool
property: read-only
Expand Down

0 comments on commit f04336b

Please sign in to comment.