summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamjan 9000 <damjan.9000@gmail.com>2024-03-31 19:36:43 +0200
committerGitHub <noreply@github.com>2024-03-31 13:36:43 -0400
commit1175f6d25a84146fda2eb16236d2a21ae30cc7b1 (patch)
treef04dc682ea7d7286f001f82e22af5847393da92e
parent93fde0556e82ead2a5392ccb678359fa59437b98 (diff)
Add a keymap space-f to format buffer using conform (#817)
This works also for visual range selection Copied from conform recipe: https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md
-rw-r--r--init.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index db55a9e..667fb9c 100644
--- a/init.lua
+++ b/init.lua
@@ -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)