Skip to content

Commit d279178

Browse files
dam9000eunmann
authored andcommitted
Add a keymap space-f to format buffer using conform (nvim-lua#817)
This works also for visual range selection Copied from conform recipe: https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md
1 parent 60e96e8 commit d279178

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

init.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,16 @@ require('lazy').setup({
608608

609609
{ -- Autoformat
610610
'stevearc/conform.nvim',
611+
keys = {
612+
{
613+
'<leader>f',
614+
function()
615+
require('conform').format { async = true, lsp_fallback = true }
616+
end,
617+
mode = '',
618+
desc = '[F]ormat buffer',
619+
},
620+
},
611621
opts = {
612622
notify_on_error = false,
613623
format_on_save = function(bufnr)

0 commit comments

Comments
 (0)