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:
parent
286c951d7b
commit
10b668d98a
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue