#editor #neovim #vim #terminal #vi

reovim-plugin-pair

Rainbow brackets, matched pair highlighting, and auto-pair insertion for reovim

5 releases

Uses new Rust 2024

0.8.1 Jan 11, 2026
0.8.0 Jan 8, 2026
0.7.10 Jan 6, 2026
0.7.9 Jan 5, 2026
0.7.8 Dec 27, 2025

#12 in #vi


Used in reovim

AGPL-3.0-only

2MB
39K SLoC

Pair plugin for reovim - bracket matching, highlighting, and auto-pair insertion

This plugin provides:

  • Rainbow bracket coloring based on nesting depth (6-color cycle)
  • Matched pair highlighting when cursor is inside brackets
  • Bold + underline highlighting when cursor is directly ON a bracket
  • Unmatched bracket warning (red underline)
  • Auto-insertion of closing brackets with cursor positioning

Supported Brackets

  • Round brackets: ( )
  • Square brackets: [ ]
  • Curly brackets: { }
  • Backticks: ` (for markdown code, template literals)
  • Single quotes: '
  • Double quotes: "

Note: Angle brackets <> are intentionally excluded as they conflict with operators (->, =>, <=, >=, <<, >>) in most languages.

Symmetric pairs (backticks, quotes) use a tracking mechanism to prevent infinite recursion when auto-inserting the closing character.

Highlighting Behavior

Cursor Position Style
On bracket ( or ) Rainbow color + bold + underline
Inside (...) Rainbow color only
Unmatched bracket Red + underline

State Management

The plugin stores PairState in PluginStateRegistry, tracking:

  • Cached bracket depth information per buffer
  • Current matched pair (if cursor is inside or on a bracket)

Dependencies

~40–60MB
~1M SLoC