Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Neovim
  3. nvim-autopairs

nvim-autopairs

MITLua0.10.0

A super powerful autopair plugin for Neovim written in Lua that automatically inserts and manages bracket pairs.

GitHubGitHub
4.1k stars140 forks0 contributors

What is nvim-autopairs?

nvim-autopairs is a Neovim plugin written in Lua that automatically inserts and manages bracket pairs (like parentheses, braces, quotes) as you type. It solves the problem of manual bracket matching, reducing keystrokes and preventing syntax errors while coding. The plugin is highly configurable and integrates with Neovim's modern features like Treesitter and completion engines.

Target Audience

Neovim users, particularly developers who write code in languages with heavy bracket usage (e.g., Lua, JavaScript, Python) and want to streamline their editing workflow with intelligent autopairing.

Value Proposition

Developers choose nvim-autopairs for its deep Neovim integration, extensive customization via Lua rules, and performance—it's a lightweight yet powerful alternative to older Vim autopair plugins, designed specifically for Neovim's Lua API.

Overview

autopairs for neovim written in lua

Use Cases

Best For

  • Automatically closing brackets and quotes while typing code in Neovim
  • Integrating autopairing with nvim-cmp or other completion plugins
  • Creating custom autopair rules for specific filetypes or syntax patterns
  • Using Treesitter to contextually enable/disable autopairs in strings or comments
  • Wrapping existing code blocks with brackets quickly via Fast Wrap
  • Disabling autopairs in specific modes like visual block or macro recording

Not Ideal For

  • Users of traditional Vim without Neovim or Lua support
  • Projects needing a plug-and-play autopair solution with zero configuration
  • Environments where editors must minimize plugin complexity for faster startup
  • Teams that prefer graphical interfaces over Lua scripting for configuration

Pros & Cons

Pros

Flexible Pair Management

Supports multiple bracket types and custom pairs, allowing adaptation to various programming languages and user preferences.

Context-Aware Insertion

Integrates with Treesitter to disable autopairs in strings or comments, preventing unwanted insertions and improving code accuracy.

Advanced Rule System

Offers a Lua API to define rules with conditions based on regex, filetype, and position, enabling precise control over autopair behavior.

Efficient Code Wrapping

Fast Wrap feature provides a keybinding to quickly enclose text with brackets, speeding up code refactoring and editing tasks.

Cons

Steep Configuration Curve

Setting up integrations with completion plugins like nvim-cmp requires complex Lua code, which can be error-prone and intimidating for newcomers.

Dependent on Neovim Ecosystem

Exclusively designed for Neovim with Lua, limiting usability in other editors or Vim setups without Lua support, creating vendor lock-in.

Potential Rule Conflicts

Custom rules can overlap or interfere, necessitating careful management to avoid unexpected autopairing behavior in complex configurations.

Frequently Asked Questions

Quick Stats

Stars4,087
Forks140
Contributors0
Open Issues13
Last commit16 days ago
CreatedSince 2021

Tags

#treesitter#productivity#code-editing#vim#neovim-plugin#plugin#autopair#text-editing#neovim#lua#nvim

Built With

N
Neovim
L
Lua

Included in

Neovim20.6k
Auto-fetched 11 hours ago

Related Projects

nvim-treesitter-contextnvim-treesitter-context

Show code context

Stars3,225
Forks240
Last commit1 month ago
zen-mode.nvimzen-mode.nvim

🧘 Distraction-free coding for Neovim

Stars2,154
Forks76
Last commit10 months ago
nvim-ts-autotagnvim-ts-autotag

Use treesitter to auto close and auto rename html tag

Stars2,118
Forks109
Last commit4 months ago
multicursor.nvimmulticursor.nvim

multiple cursors in neovim

Stars1,532
Forks14
Last commit5 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub