Skip to content

Commit d5f062c

Browse files
restrayTimothée Belhomme
authored and
Timothée Belhomme
committed
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 ee01f47 commit d5f062c

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
@@ -600,6 +600,16 @@ require('lazy').setup({
600600

601601
{ -- Autoformat
602602
'stevearc/conform.nvim',
603+
keys = {
604+
{
605+
'<leader>f',
606+
function()
607+
require('conform').format { async = true, lsp_fallback = true }
608+
end,
609+
mode = '',
610+
desc = '[F]ormat buffer',
611+
},
612+
},
603613
opts = {
604614
notify_on_error = false,
605615
format_on_save = function(bufnr)

0 commit comments

Comments
 (0)