stevearc / conform.nvim

Lightweight yet powerful formatter plugin for Neovim
MIT License
2.72k stars 142 forks source link

Disable trailing newline globally #362

Open elkrammer opened 4 months ago

elkrammer commented 4 months ago

Is there a way to prevent conform.nvim from adding trailing newlines at a global level? Some formatters allow disabling / customizing this behavior but not all formatters support it.

Is there a way to make conform.nvim strip trailing newlines on BufWritePost for all fileformats?

atchim commented 2 months ago

I'm also having problems with new lines at the end of files. In my case, I've set StyLua to format Lua files. By running stylua . on the command line, the formatter formats correctly (with no new line at the end). But, when calling formatting with Conform, even explicitly setting lsp_fallback to false, the code gets formatted with an ending new line.