Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rareitems/hl_match_area.nvim
Neovim plugin that allows highlighting the whole area between matching delimiters ('{}' '[]' '()' '<>')
https://github.com/rareitems/hl_match_area.nvim
Last synced: 8 days ago
JSON representation
Neovim plugin that allows highlighting the whole area between matching delimiters ('{}' '[]' '()' '<>')
- Host: GitHub
- URL: https://github.com/rareitems/hl_match_area.nvim
- Owner: rareitems
- License: gpl-3.0
- Created: 2022-10-25T14:09:03.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-18T09:43:20.000Z (about 1 year ago)
- Last Synced: 2024-08-02T18:36:58.824Z (3 months ago)
- Language: Lua
- Size: 32.2 KB
- Stars: 50
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-neovim-pluginlist - rareitems/hl_match_area.nvim - commit/rareitems/hl_match_area.nvim) ![](https://img.shields.io/github/commit-activity/y/rareitems/hl_match_area.nvim) (Editing support / matchparen)
README
hl_match_area.nvim
Neovim plugin that allows highlighting the whole area between matching delimiters (specified by `vim.opt.matchpairs`)![demo](https://user-images.githubusercontent.com/83038443/197796655-b1ff0a7a-ed5b-4922-96d4-3acc7b87e1b5.gif)
## Installation
- With [packer.nvim](https://github.com/wbthomason/packer.nvim)
```lua
use { 'rareitems/hl_match_area.nvim' }
```## Usage
Simply call the following function somewhere in your config
```lua
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)
```lua
{
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:
```lua
vim.api.nvim_set_hl(0, 'MatchArea', {bg = "#FFFFFF"})
```## Configuration
```lua
{
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: `{"(:)", "{:}"}`) }
}
```