mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-15 11:54:36 +02:00
fix(format): moved formatting keymap to lua/lazyvim/config/keymaps.lua
This commit is contained in:
parent
e36f7d811c
commit
9b16770573
2 changed files with 5 additions and 5 deletions
|
@ -103,6 +103,11 @@ if not Util.has("trouble.nvim") then
|
||||||
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- formatting
|
||||||
|
map({ "n", "v" }, "<leader>cf", function()
|
||||||
|
require("lazyvim.plugins.lsp.format").format({ force = true })
|
||||||
|
end, { desc = "Format" })
|
||||||
|
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
|
|
||||||
-- toggle options
|
-- toggle options
|
||||||
|
|
|
@ -5,9 +5,6 @@ M._keys = nil
|
||||||
|
|
||||||
---@return (LazyKeys|{has?:string})[]
|
---@return (LazyKeys|{has?:string})[]
|
||||||
function M.get()
|
function M.get()
|
||||||
local format = function()
|
|
||||||
require("lazyvim.plugins.lsp.format").format({ force = true })
|
|
||||||
end
|
|
||||||
if not M._keys then
|
if not M._keys then
|
||||||
---@class PluginLspKeys
|
---@class PluginLspKeys
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
|
@ -28,8 +25,6 @@ function M.get()
|
||||||
{ "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" },
|
{ "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" },
|
||||||
{ "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" },
|
{ "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" },
|
||||||
{ "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" },
|
{ "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" },
|
||||||
{ "<leader>cf", format, desc = "Format Document", has = "formatting" },
|
|
||||||
{ "<leader>cf", format, desc = "Format Range", mode = "v", has = "rangeFormatting" },
|
|
||||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
||||||
{
|
{
|
||||||
"<leader>cA",
|
"<leader>cA",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue