A Prettier plugin for Neovim's built-in LSP client, enabling code formatting via null-ls.
prettier.nvim is a Neovim plugin that integrates the Prettier code formatter with Neovim's built-in Language Server Protocol (LSP) client. It enables developers to format code directly within Neovim using Prettier's rules, supporting features like format-on-save and visual range formatting. The plugin works through null-ls.nvim to bridge Prettier with Neovim's LSP capabilities.
Neovim users who want to integrate Prettier for consistent code formatting across JavaScript, TypeScript, CSS, and other supported file types within their editor workflow.
It provides a seamless, LSP-native way to use Prettier in Neovim, offering better performance and integration compared to standalone formatter plugins, with support for advanced features like config precedence and conditional formatting.
Prettier plugin for Neovim's built-in LSP client.
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 Neovim's built-in LSP client via null-ls for consistent formatting workflows, as shown in the setup with vim.lsp.buf.format for seamless editor integration.
Supports extensive Prettier CLI options, filetype-specific settings, and config precedence, allowing detailed customization per project or globally.
Enables automatic formatting on buffer write with customizable autocmds, detailed in the null-ls setup for BufWritePre or BufWritePost events.
Can be used without LSP setup via provided keymaps and commands like :Prettier, offering flexibility for different workflows.
Requires null-ls.nvim and nvim-lspconfig as dependencies, adding setup complexity and potential conflicts in the plugin ecosystem.
Prettier is not automatically installed by the plugin, necessitating separate global or local installation, which can be a hurdle for new users.
LSP integration methods only work if a Prettier config file is present in the project, limiting usability in config-less or ad-hoc environments.