Skip to content

Rainbow highlighting and intelligent auto-pairs for Neovim

License

Notifications You must be signed in to change notification settings

Saghen/blink.pairs

Repository files navigation

Blink Pairs (blink.pairs)

Rainbow highlighting and auto-pairs for Neovim. Uses a custom parser internally which takes ~4ms to parse a 400k character file, and ~0.2ms for subsequent incremental updates. See the roadmap for the current status, contributions welcome!

Behavior

The behavior was inspired by lexima.vim and nvim-autopairs

Before Input After
| ( (|)
| " "|"
""| " """|"""
''| ' '''|'''
\| [ \[|
\| " \"|
\| ' \'|
A ' A'
(|) ) ()|
'|' ' ''|
'''|''' ' ''''''|
(|) <BS> |
'|' <BS> |
( | ) <BS> (|)
(|) <Space> ( | )

Installation

{
  'saghen/blink.pairs',
  version = '*', -- (recommended) only required with prebuilt binaries

  -- download prebuilt binaries from github releases
  dependencies = 'saghen/blink.download',
  -- OR build from source
  build = 'cargo build --release',
  -- OR build from source with nix
  build = 'nix build .#build-plugin',

  --- @module 'blink.pairs'
  --- @type blink.pairs.Config
  opts = {
    mappings = {
      -- you can call require("blink.pairs.mappings").enable() and require("blink.pairs.mappings").disable() to enable/disable mappings at runtime
      enabled = true,
      -- see the defaults: https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/config/mappings.lua#L10
      pairs = {},
    },
    highlights = {
      enabled = true,
      groups = {
        'BlinkPairsOrange',
        'BlinkPairsPurple',
        'BlinkPairsBlue',
      },
    },
    debug = false,
  }
}

About

Rainbow highlighting and intelligent auto-pairs for Neovim

Resources

License

Stars

Watchers

Forks

Packages

No packages published