make formatting mapping <leader>fm as general mapping #2167

so its available even if an actual lsp isnt attached to the buffer
This commit is contained in:
siduck 2023-06-29 05:18:18 +05:30
parent 286c951d7b
commit 10b668d98a

View file

@ -45,6 +45,13 @@ M.general = {
-- new buffer -- new buffer
["<leader>b"] = { "<cmd> enew <CR>", "New buffer" }, ["<leader>b"] = { "<cmd> enew <CR>", "New buffer" },
["<leader>ch"] = { "<cmd> NvCheatsheet <CR>", "Mapping cheatsheet" }, ["<leader>ch"] = { "<cmd> NvCheatsheet <CR>", "Mapping cheatsheet" },
["<leader>fm"] = {
function()
vim.lsp.buf.format { async = true }
end,
"LSP formatting",
},
}, },
t = { t = {
@ -193,14 +200,14 @@ M.lspconfig = {
["[d"] = { ["[d"] = {
function() function()
vim.diagnostic.goto_prev({ float = { border = "rounded" }}) vim.diagnostic.goto_prev { float = { border = "rounded" } }
end, end,
"Goto prev", "Goto prev",
}, },
["]d"] = { ["]d"] = {
function() function()
vim.diagnostic.goto_next({ float = { border = "rounded" }}) vim.diagnostic.goto_next { float = { border = "rounded" } }
end, end,
"Goto next", "Goto next",
}, },
@ -212,13 +219,6 @@ M.lspconfig = {
"Diagnostic setloclist", "Diagnostic setloclist",
}, },
["<leader>fm"] = {
function()
vim.lsp.buf.format { async = true }
end,
"LSP formatting",
},
["<leader>wa"] = { ["<leader>wa"] = {
function() function()
vim.lsp.buf.add_workspace_folder() vim.lsp.buf.add_workspace_folder()