Skip to content

HampusHauffman/block.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

❐block.nvim

Neovim GitHub repo stars

image Screenshot is taken on Kitty terminal with font_family FiraCode Nerd Font and dracula as colortheme.

⚡️ Requirements

Neovim Stable release and up (Have not tested how far back this works).

🚀 Usage

:Block Toggle current buffer

:BlockOn On current buffer

:BlockOff Off current buffer

📦 Installation

{
    "HampusHauffman/block.nvim",
    config = function()
        require("block").setup({})
    end
},

⚙️ Configuration / Setup

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"
--      },
    })

🤔 Motivation

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.

📝 Todo

  • 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

image This is an example of manually set colors.

Contribution

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages