https://github.com/tar80/matchwith.nvim
Simpler matchparen and matchit
https://github.com/tar80/matchwith.nvim
neovim-plugin
Last synced: 3 months ago
JSON representation
Simpler matchparen and matchit
- Host: GitHub
- URL: https://github.com/tar80/matchwith.nvim
- Owner: tar80
- License: apache-2.0
- Created: 2024-04-07T06:51:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-08T13:41:32.000Z (3 months ago)
- Last Synced: 2025-04-08T13:45:01.866Z (3 months ago)
- Topics: neovim-plugin
- Language: Lua
- Homepage:
- Size: 125 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- my-neovim-pluginlist - tar80/matchwith.nvim - commit/tar80/matchwith.nvim)  (Editing support / matchparen)
README
# matchwith.nvim
matchwith.nvim is a matchparen and matchit alternative plugin.
Provides simpler functionality using treesitter.> [!CAUTION]
> We have confirmed some bugs and are currently working on fixing them.## Features
Displays off-screen match symbols.

Highlight the next capture match and parent node match.

## Requirements
- Neovim >= 0.11.0
## Installation
- lazy.nvim
```lua:
{
'tar80/matchwith.nvim',
opts = {
...
},
}
```## Configuration
Defalut values.
```lua
require('matchwith').setup({
captures = {
['*'] = { 'keyword.function', 'keyword.repeat', 'keyword.conditional', 'punctuation.bracket', 'constructor' },
off_side = { 'punctuation.bracket' },
},
debounce_time = 50,
depth_limit = 10,
ignore_buftypes = { 'nofile' },
ignore_filetypes = { 'vimdoc' }, -- Suggested items: 'TelescopePrompt', 'TelescopeResults', 'cmp_menu', 'cmp_docs' ,'fidget', 'snacks_picker_input'
indicator = 0,
jump_key = nil, -- e.g. '%'
off_side = { 'query', 'fsharp', 'haskell', 'ocaml', 'make', 'nim', 'python', 'sass', 'scss', 'yaml' },
priority = 100,
show_next = false,
show_parent = false,
sign = false,
symbols = { [1] = '↑', [2] = '↓', [3] = '→', [4] = '↗', [5] = '↘', [6] = '←', [7] = '↖', [8] = '↙' },
})
```To properly handle HTML and other framework-specific elements,
consider adding the following options.> [!NOTE]
> `opts.alter_filetypes` is no longer available. The parser used is automatically determined.```lua
opts = {
alter_filetypes -- @deprecated
captures = {
javascript = { 'tag.delimiter', 'punctuation.bracket' 'keyword.function', 'keyword.repeat', 'keyword.conditional', 'constructor' },
html = { 'tag.delimiter', 'punctuation.bracket' },
svelte = { 'tag.delimiter', 'punctuation.bracket' },
}
},
```### Operator keys
Matchwith provides four operator keys corresponding to matchepair.
- `(matchwith-operator-i)` Inner range of the current/next matchpair
- `(matchwith-operator-a)` A range of the current/next matchpair
- `(matchwith-operator-parent-i)` Inner range or the parent matchpair
- `(matchwith-operator-parent-a)` A range or the parent matchpairRegister like this:
```lua
vim.keymap.set({'o','x'}, 'i%', '(matchwith-operator-i)')
vim.keymap.set({'o','x'}, 'a%', '(matchwith-operator-a)')
vim.keymap.set({'o','x'}, 'iP', '(matchwith-operator-parent-i)')
vim.keymap.set({'o','x'}, 'aP', '(matchwith-operator-parent-a)')
```