From 97f72936acaaaab1d10bd986ba27febc2e4510b0 Mon Sep 17 00:00:00 2001 From: jdhao Date: Tue, 5 Nov 2024 22:03:46 +0100 Subject: [PATCH] Enable LSP format also for visual selection --- lua/config/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 25f1a7d..6d0b286 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -48,7 +48,7 @@ local custom_attach = function(client, bufnr) -- Set some key bindings conditional on server capabilities if client.server_capabilities.documentFormattingProvider then - map("n", "f", vim.lsp.buf.format, { desc = "format code" }) + map({"n", "x"}, "f", vim.lsp.buf.format, { desc = "format code" }) end -- Uncomment code below to enable inlay hint from language server, some LSP server supports inlay hint,