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
1 changed files with 9 additions and 9 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue