refactor(nvim): switch `<leader>c` with `<leader>l`

main
sgoudham 1 year ago
parent 4fc294ebfe
commit cf0cc9d2ef
Signed by: hammy
GPG Key ID: 44E818FD5457EEA4

@ -2,6 +2,27 @@ return {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
---@class PluginLspOpts ---@class PluginLspOpts
init = function()
local keys = require("lazyvim.plugins.lsp.keymaps").get()
local function swap_prefix(before, after)
for _, keymap in ipairs(keys) do
local key = keymap[1]
if key:sub(1, #before) == before then
keymap[1] = after .. key:sub(#before + 1)
end
end
end
local leader_c = "<leader>c"
local leader_l = "<leader>l"
swap_prefix(leader_c, leader_l)
require("which-key").register({
[leader_c] = "pkgs",
[leader_l] = "code",
})
keys[#keys + 1] = { "gl", vim.diagnostic.open_float, "Line Diagnostics" }
end,
opts = { opts = {
diagnostics = { diagnostics = {
underline = false, underline = false,

Loading…
Cancel
Save