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
1 changed files with 9 additions and 9 deletions

View File

@ -45,6 +45,13 @@ M.general = {
-- new buffer
["<leader>b"] = { "<cmd> enew <CR>", "New buffer" },
["<leader>ch"] = { "<cmd> NvCheatsheet <CR>", "Mapping cheatsheet" },
["<leader>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",
},
["<leader>fm"] = {
function()
vim.lsp.buf.format { async = true }
end,
"LSP formatting",
},
["<leader>wa"] = {
function()
vim.lsp.buf.add_workspace_folder()