From 10b668d98aba6bce9b494d028174207e59e5c59a Mon Sep 17 00:00:00 2001 From: siduck Date: Thu, 29 Jun 2023 05:18:18 +0530 Subject: [PATCH] make formatting mapping fm as general mapping #2167 so its available even if an actual lsp isnt attached to the buffer --- lua/core/mappings.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 625d4fc..acc2948 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -45,6 +45,13 @@ M.general = { -- new buffer ["b"] = { " enew ", "New buffer" }, ["ch"] = { " NvCheatsheet ", "Mapping cheatsheet" }, + + ["fm"] = { + function() + vim.lsp.buf.format { async = true } + end, + "LSP formatting", + }, }, t = { @@ -193,14 +200,14 @@ M.lspconfig = { ["[d"] = { function() - vim.diagnostic.goto_prev({ float = { border = "rounded" }}) + vim.diagnostic.goto_prev { float = { border = "rounded" } } end, "Goto prev", }, ["]d"] = { function() - vim.diagnostic.goto_next({ float = { border = "rounded" }}) + vim.diagnostic.goto_next { float = { border = "rounded" } } end, "Goto next", }, @@ -212,13 +219,6 @@ M.lspconfig = { "Diagnostic setloclist", }, - ["fm"] = { - function() - vim.lsp.buf.format { async = true } - end, - "LSP formatting", - }, - ["wa"] = { function() vim.lsp.buf.add_workspace_folder()