Add a keymap space-f to format buffer using conform

This works also for visual range selection
Copied from conform recipe:
https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md
This commit is contained in:
Damjan 9000 2024-03-31 17:55:44 +02:00
parent 93fde0556e
commit 7010486100
1 changed files with 10 additions and 0 deletions

View File

@ -600,6 +600,16 @@ require('lazy').setup({
{ -- Autoformat
'stevearc/conform.nvim',
keys = {
{
'<leader>f',
function()
require('conform').format { async = true, lsp_fallback = true }
end,
mode = '',
desc = '[F]ormat buffer',
},
},
opts = {
notify_on_error = false,
format_on_save = function(bufnr)