Vim Pairify banner
dhruvasagar dhruvasagar

Vim Pairify

Development community

Description

A simplistic vim plugin to deal with pairs non-intrusively

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

vim-pairify v0.6.0 [![Build](https://github.com/dhruvasagar/vim-pairify/actions/workflows/ci.yml/badge.svg)](https://github.com/dhruvasagar/vim-pairify/actions/workflows/ci.yml)

A simple plugin for pair completion such as `()` and `[]`. Press Ctrl-J in insert mode and the plugin identifies the correct closing character to insert. It handles nesting and multiline matching.

How it works

The plugin scans backwards from the cursor through all preceding lines, tracking open and close pairs on a stack. When it finds an unmatched opening character it inserts the corresponding closing character. If the cursor is already sitting before a closing character it moves past it instead.

**Angle brackets** (`<` and `>`) are treated as comparison operators when surrounded by a space (e.g. `a < b`) and as angle bracket pairs when not (e.g. `vector

Default pairs

Opener Closer
( )
[ ]
{ }
< >
' '
" "
` `

Installation

Using any plugin manager (Pathogen, Vundle, vim-plug, etc.) or Vim 8+'s built-in package support:

# vim-plug
Plug 'dhruvasagar/vim-pairify'

# built-in packages
git clone https://github.com/dhruvasagar/vim-pairify \
  ~/.vim/pack/plugins/start/vim-pairify

Configuration

Change the trigger key

The default mapping is Ctrl-J. To use a different key, set `g:pairify_map` in your vimrc **before** the plugin loads:

let g:pairify_map = ''

Customise pairs

Set `g:pairifiers` in your vimrc **before** the plugin loads to replace the default pair set entirely. The dict requires a `left` map (opener → closer) and a `right` map (closer → opener):

" Example: drop angle brackets and add | for Rust closures
let g:pairifiers = {
      \ 'left':  { '(': ')', '[': ']', '{': '}', "'": "'", '"': '"', '`': '`', '|': '|' },
      \ 'right': { ')': '(',