A treesitter-based structural search and replace plugin for Neovim, enabling AST-level code transformations.
ssr.nvim is a structural search and replace plugin for Neovim that uses treesitter to perform AST-level code transformations. It allows developers to search for code patterns based on syntactic structure and replace them with new patterns, supporting wildcards for flexible matching. This enables more accurate and powerful refactoring compared to traditional text-based search and replace.
Neovim users, particularly software developers and engineers who regularly refactor code in languages supported by treesitter and want IDE-like structural search capabilities directly in their editor.
It provides a lightweight, treesitter-integrated solution for structural search and replace within Neovim, offering greater accuracy than text-based tools while avoiding the overhead of full LSP implementations. The plugin's context-aware parsing and interactive replacement workflow make complex refactoring tasks more intuitive.
Treesitter based structural search and replace plugin for Neovim.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages treesitter to parse code into abstract syntax trees, enabling pattern matching based on structure rather than text, which reduces errors in complex refactoring tasks.
Supports wildcards like $name in search patterns to match any AST node and reference them in replacements, allowing for reusable and flexible code transformations.
Parses search patterns within their original code context, improving accuracy for languages like TypeScript where syntax interpretation depends on surrounding code.
Provides a floating window UI for previewing matches and choosing to replace individual occurrences or all matches, giving developers precise control over changes.
Operates only at AST level without deep code intelligence, so it may miss semantic nuances that LSP servers handle, such as type safety or cross-file references.
Requires treesitter to be installed and configured for each language, adding setup complexity and potentially failing for languages with unstable parsers.
Success hinges on correct cursor placement or region selection when opening SSR, which can be error-prone and require trial-and-error in complex code.
ssr.nvim is an open-source alternative to the following products: