Screenshot is taken on Kitty
terminal with font_family FiraCode Nerd Font
and dracula
as colortheme.
Neovim Stable release and up (Have not tested how far back this works).
{
"HampusHauffman/block.nvim",
config = function()
require("block").setup({})
end
},
To change the defaults you can change any of the following values:
---@field percent number -- The change in color. 0.8 would change each box to be 20% darker than the last and 1.2 would be 20% brighter.
---@field depth number -- De depths of changing colors. Defaults to 4. After this the colors reset. Note that the first color is taken from your "Normal" highlight so a 4 is 3 new colors.
---@field automatic boolean -- Automatically turns this on when treesitter finds a parser for the current file.
---@field colors string [] | nil -- A list of colors to use instead. If this is set percent and depth are not taken into account.
---@field bg string? -- If you'd prefer to use a different color other than the default "Normal" highlight.
require("block").setup({
percent = 0.8,
depth = 4,
colors = nil,
automatic = false,
-- bg = nil,
-- colors = {
-- "#ff0000"
-- "#00ff00"
-- "#0000ff"
-- },
})
This plugin is something i've wanted for a while but havent found any previous implementation of in neovim. My hope is it will help with legibility in deeply nested code.
- Bug test and fix any community found issues
- Add vim docs for usage
- Handle multi character characters such as emojis
- Potentially add virtual lines as a means to improve visibility even more
This is an example of manually set colors.
Currently development has been put on hold while i switch jobs. I'll still look at any PR's coming in. I know there is some performance issues that i intend to fix in the future but i do not have time ATM.