A Neovim plugin that highlights the current code block under the cursor with transparency support.
- 🎯 Automatically detects and highlights the current code block
- 🎨 Transparency support for seamless integration
- ⚡ Debounced updates for smooth performance
- 🔧 Fully customizable
- Neovim >= 0.8.0
Using lazy.nvim
{
"qrazil/current-block.nvim",
config = function()
require("current-block").setup({
highlight_group = "CurrentBlock",
debounce_ms = 100,
enabled = true,
blend = 30, -- 0-100, where 0 is fully transparent
})
end,
}Using packer.nvim
use {
"qrazil/current-block.nvim",
config = function()
require("current-block").setup()
end
}Using vim-plug
Plug 'qrazil/current-block.nvim'
lua << EOF
require("current-block").setup()
EOFDefault configuration:
require("current-block").setup({
highlight_group = "CurrentBlock", -- Highlight group name
debounce_ms = 100, -- Update delay in milliseconds
enabled = true, -- Enable on startup
blend = 30, -- Transparency level (0-100)
})-- After setup, customize the highlight
vim.api.nvim_set_hl(0, 'CurrentBlock', {
bg = "#2e3440",
blend = 20
}):CurrentBlockToggle- Toggle highlighting on/off:CurrentBlockEnable- Enable highlighting:CurrentBlockDisable- Disable highlighting
The plugin detects code blocks based on indentation levels and highlights all lines at the same or deeper indentation level as the current cursor position.
Apache License - see LICENSE file for details