{"repo":"elentok/format-on-save.nvim","free":true,"listed":false,"github":"https://github.com/elentok/format-on-save.nvim","clone":"git clone https://github.com/elentok/format-on-save.nvim.git","description":"Automatically formats files when saving using either LSP or shell utilities like prettierd or shfmt","language":"Lua","stars":172,"topics":["formatter","lsp","neovim-plugin","formatting","nvim","nvim-plugin"],"license":"MIT","category":"dev-tools","readme_excerpt":"format-on-save.nvim [!IMPORTANT] This plugin is no longer maintained since I switched to conform.nvim. There were some bug that I didn't have the time to fix and conform.nvim just worked. If anyone wants to take over, feel free to fork it, let me know and I'd be happy to add a notice here to point to the new project :) Automatically formats files when saving using either LSP or shell utilities like prettierd or shfmt. It also restores the cursor of any window showing the current file (useful when editing the same file in a split). NOTE: This is a work in progress and the API might change. Why another formatting plugin? Until now I've used LSP-only formatting with a simple auto command with null-ls to cover non-LSP formatters. However, now that null-ls is being archived I needed to find an alternative. I tried several plugins but: - Neither supported both LSP and non-LSP formatters - Some of them format asynchronously which is tricky because you need to lock the buffer before formatting and there are a lot of edge cases. - Some of them support partial formatting which adds a lot of complexity. This plugin has a few core principles to keep it simple: - Synchronous formatting - Most of the formatters I use are quite fast and the delay isn't noticeable to me. - Format on save only (no partial formatting) - There's a :Format command you can call whenever you want but the purpose of this plugin is to format when saving. TODO - [x] Add LazyFormatter - a function that is only called ","default_branch":null,"files":null,"tree":[],"storefront":"/r/elentok","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/elentok/format-on-save.nvim/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}