A Neovim plugin that splits arguments and containers onto separate lines, powered by treesitter.
nvim-trevJ.lua is a Neovim plugin that splits container nodes—like function arguments, table constructors, and parameters—onto separate lines, acting as the opposite of the join-line command. It solves the problem of manually reformatting code for better readability by automating the process with treesitter accuracy. The plugin is a reimplementation of the older revJ plugin, offering enhanced performance and reliability.
Neovim users, particularly developers who work with languages like Lua, JavaScript, Python, and Rust, and want efficient, context-aware code formatting directly in their editor.
Developers choose nvim-trevJ.lua for its treesitter-driven precision, which ensures correct formatting without common side effects like register pollution. It provides a configurable, language-specific approach that outperforms its predecessor in both speed and usability.
Nvim-plugin for doing the opposite of join-line (J) of arguments, powered by treesitter
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses treesitter to accurately identify container nodes like arguments and tables, ensuring reliable formatting without errors, as highlighted in the README's emphasis on context-aware parsing.
Supports per-language configuration for separators and line endings, demonstrated with examples for Lua and HTML in the setup section, allowing tailored formatting rules.
Avoids polluting registers or altering visual selections, providing a clean editing experience as noted in the plugin's philosophy of minimal intrusion.
Offers better performance and efficiency than the revJ plugin, with a smooth migration path for existing users, as stated in the introduction.
Requires precise cursor placement inside the container node; otherwise, a warning is given, which can lead to formatting failures if not positioned correctly.
Adding support for unsupported languages necessitates understanding treesitter node types and writing custom Lua code, which may be daunting for casual users, as admitted in the README.
Only 15 languages are supported by default, and users must manually add others or submit PRs, reducing immediate usability for less common languages.