-- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here local function unmap(mode, key) vim.keymap.del(mode, key, {}) end unmap("n", "ww") unmap("n", "w-") unmap("n", "w|") unmap("n", "wd") unmap("n", "l") unmap("n", "H") unmap("n", "L") unmap("i", "") unmap("i", "") require("which-key").register({ ["w"] = "which_key_ignore", }) local function map(mode, lhs, rhs, opts) local keys = require("lazy.core.handler").handlers.keys ---@cast keys LazyKeysHandler -- do not create the keymap if a lazy keys handler exists if not keys.active[keys.parse({ lhs, mode = mode }).id] then opts = opts or {} opts.silent = opts.silent ~= false if opts.remap and not vim.g.vscode then opts.remap = nil end vim.keymap.set(mode, lhs, rhs, opts) end end map("n", "0", "0^", { desc = "which_key_ignore " }) map("n", "", "o", { desc = "which_key_ignore " }) map("n", "", "zz", { desc = "which_key_ignore " }) map("n", "", "zz", { desc = "which_key_ignore " }) map("n", "w", "w", { desc = "which_key_ignore", nowait = true }) map("n", "Q", "qa", { desc = "which_key_ignore" }) map("n", "q", "q", { desc = "which_key_ignore", nowait = true }) -- Clipboard map("n", "y", [["+y]], { desc = "which_key_ignore" }) map("n", "p", [["+p]], { desc = "which_key_ignore" }) map("n", "", "h", { desc = "Go to left window", remap = true }) map("n", "", "j", { desc = "Go to lower window", remap = true }) map("n", "", "k", { desc = "Go to upper window", remap = true }) map("n", "", "l", { desc = "Go to right window", remap = true })