Skip to content

qrazil/current-block.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

current-block.nvim

A Neovim plugin that highlights the current code block under the cursor with transparency support.

Features

  • 🎯 Automatically detects and highlights the current code block
  • 🎨 Transparency support for seamless integration
  • ⚡ Debounced updates for smooth performance
  • 🔧 Fully customizable

Requirements

  • Neovim >= 0.8.0

Installation

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,
}
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()
EOF

Configuration

Default 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)
})

Custom Colors

-- After setup, customize the highlight
vim.api.nvim_set_hl(0, 'CurrentBlock', { 
  bg = "#2e3440", 
  blend = 20 
})

Commands

  • :CurrentBlockToggle - Toggle highlighting on/off
  • :CurrentBlockEnable - Enable highlighting
  • :CurrentBlockDisable - Disable highlighting

How it Works

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.

License

Apache License - see LICENSE file for details

About

Use blocks to highlight current scope!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages