A Zsh plugin that automatically closes, deletes, and skips over matching delimiters like brackets and quotes.
zsh-autopair is a Zsh plugin that automatically manages delimiter pairs like brackets, quotes, and spaces during command-line typing. It inserts matching pairs, skips over closed delimiters, and deletes pairs intelligently, streamlining shell interaction and reducing manual editing.
Zsh users, command-line enthusiasts, and developers who frequently write shell scripts or work in terminal environments and want faster, less error-prone editing.
It offers a lightweight, configurable solution for delimiter handling that integrates seamlessly with Zsh, improving typing efficiency without complex setup or performance overhead.
Auto-close and delete matching delimiters in zsh
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically inserts, skips, and deletes delimiter pairs based on context, reducing keystrokes—e.g., typing a quote produces a pair with the cursor inside, as demonstrated in the README examples.
Uses AUTOPAIR_LBOUNDS and AUTOPAIR_RBOUNDS to define when pairing should occur, preventing unwanted inserts near boundary characters and ensuring sensible behavior.
Works well with other Zsh tools like zsh-syntax-highlighting and vi-mode modules when loaded in the correct order, enhancing the overall editing experience without conflicts.
Allows users to add or remove delimiter pairs via the AUTOPAIR_PAIRS associative array, supporting custom workflows like adding angle brackets for specific scripting needs.
Installation requires precise ordering with some plugin managers; for instance, zplug must load it after compinit, and misconfiguration can lead to non-functionality or broken bindings.
Conflicts with tools like Midnight Commander (causing hangs) and Prezto's Editor module, necessitating manual workarounds that add complexity, as outlined in the troubleshooting section.
Can disrupt tab completion, requiring rebinding to expand-or-complete-prefix, which has the side effect of overwriting text to the right of the cursor, a trade-off admitted in the README.
Exclusively targets Zsh, offering no support for other popular shells like Bash or Fish, which restricts its utility in mixed-shell environments or for users transitioning between shells.