Skip to content

Neovim plugin that allows highlighting the whole area between matching delimiters ('{}' '[]' '()' '<>')

License

Notifications You must be signed in to change notification settings

rareitems/hl_match_area.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hl_match_area.nvim

Neovim plugin that allows highlighting the whole area between matching delimiters (specified by `vim.opt.matchpairs`)

demo

Installation

use { 'rareitems/hl_match_area.nvim' }

Usage

Simply call the following function somewhere in your config

  require("hl_match_area").setup()

If you don't provide any arguments to the setup function, default values will be used, which are as follows (obviously you can also change them)

{
    highlight_in_insert_mode = true, -- should highlighting also be done in insert mode
    delay = 100, -- delay before the highglight
}

Changing the highglight can be done through Neovim API. For example:

vim.api.nvim_set_hl(0, 'MatchArea', {bg = "#FFFFFF"})

Configuration

{
        delay = 100 --(number) Delay in milliseconds to highlight
        highlight_in_insert_mode = true --(boolean) If true highlight will also be done in insert mode
        matchpairs  = { "(:)", "{:}", "[:]", "<:>" } --(string[]|nil)  If you want to highlight specific characters and not rely on `vim.opt.matchpairs`. This should follow the same structure as `vim.opt.matchpairs:get` (example: `{"(:)", "{:}"}`) }
}

About

Neovim plugin that allows highlighting the whole area between matching delimiters ('{}' '[]' '()' '<>')

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages