Skip to content

πŸ’Ž Blink-Bang-Word-Light is a Neovim plugin that highlights the word under the cursor throughout the buffer.

License

Notifications You must be signed in to change notification settings

mei28/blink-bang-word-light.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Blink-Bang-Word-Light

πŸ’Ž Blink-Bang-Word-Light is a Neovim plugin that highlights the word under the cursor throughout the buffer. The plugin provides commands to enable, disable, and toggle the highlighting.

bbwl

β˜€οΈ Features

  • Highlights the word under the cursor throughout the buffer.
  • Customizable highlight settings including foreground color, background color, and underline.
  • Commands to enable, disable, and toggle highlighting.

πŸ“₯ Installation

Using Lazy.nvim

return {
    'mei28/blink-bang-word-light.nvim',
    event = { 'VeryLazy' },
    config = function()
        require('blink-bang-word-light').setup({
            -- if you want to customize, see Usage!
        })
    end
}

🧰 Usage

require('blink-bang-word-light').setup({
  max_word_length = 100, -- if cursorword length > max_word_length then not highlight
  min_word_length = 2, -- if cursorword length < min_word_length then not highlight
  excluded = {
      filetypes = {
          "TelescopePrompt",
      },
      buftypes = {
          -- "nofile",
          -- "terminal",
      },
      patterns = { -- the pattern to match with the file path
          -- "%.png$",
          -- "%.jpg$",
          -- "%.jpeg$",
          -- "%.pdf$",
          -- "%.zip$",
          -- "%.tar$",
          -- "%.tar%.gz$",
          -- "%.tar%.xz$",
          -- "%.tar%.bz2$",
          -- "%.rar$",
          -- "%.7z$",
          -- "%.mp3$",
          -- "%.mp4$",
      },
  },
  highlight = {
    underline = true,
    guifg = '#ffcc00', -- Foreground color
    guibg = '#333333', -- Background color
  },
  enabled = true,
})

βš™οΈ Configuration

You can customize the plugin settings by calling the setup function in your init.vim or init.lua. Here is an example configuration:

require('blink-bang-word-light').setup({
  max_word_length = 100, -- if cursorword length > max_word_length then not highlight
  min_word_length = 2, -- if cursorword length < min_word_length then not highlight
  excluded = {
      filetypes = {
          "TelescopePrompt",
      },
      buftypes = {
          -- "nofile",
          -- "terminal",
      },
      patterns = { -- the pattern to match with the file path
          -- "%.png$",
          -- "%.jpg$",
          -- "%.jpeg$",
          -- "%.pdf$",
          -- "%.zip$",
          -- "%.tar$",
          -- "%.tar%.gz$",
          -- "%.tar%.xz$",
          -- "%.tar%.bz2$",
          -- "%.rar$",
          -- "%.7z$",
          -- "%.mp3$",
          -- "%.mp4$",
      },
  },
  highlight = {
    underline = true,
    guifg = '#ffcc00', -- Foreground color
    guibg = '#333333', -- Background color
  },
  enabled = true,
})

Default configuration

{
  max_word_length = 100,
  min_word_length = 2,
  excluded = {
    filetypes = {},
    buftypes = {
      "prompt",
      "terminal",
    },
    patterns = {},
  },
  highlight = {
    underline = true,
    guifg = nil,
    guibg = nil,
  },
  enabled = true,
}

πŸ“– Commands

The following commands are available to control the highlighting:

  • :BlinkBangWordLight enable or :BBWL enable: Enable the highlighting.
  • :BlinkBangWordLight disable or :BBWL disable: Disable the highlighting.
  • :BlinkBangWordLight toggle or :BBWL toggle: Toggle the highlighting.

License

This plugin is licensed under the MIT License.

Similar plugins

About

πŸ’Ž Blink-Bang-Word-Light is a Neovim plugin that highlights the word under the cursor throughout the buffer.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages