local function map(mode, lhs, rhs, info) vim.keymap.set(mode, lhs, rhs, { desc = info }) end -- Basics map("n", ";", ":", "Command mode") map("n", "qq", "qa!", "Quit all") map("n", "U", "redo", "Redo") map({ "i", "n" }, "", "noh", "Clear search") map({ "i", "n", "s", "v" }, "", "w", "Save file") map("n", "", "bd", "Delete buffer") map("n", "", "enew", "New File") map("n", "", "^Da", "Rewrite line") map("i", "", "^Da", "Rewrite line") map("n", "", ":%s///g", "Replace word under cursor") map({ "n", "v" }, "", "^", "Beginning of line") map("i", "", "^i", "Beginning of line") map({ "i", "n", "v" }, "", "", "End of line") -- Indenting map("v", "<", "", ">gv") -- LSP map("n", "gr", vim.lsp.buf.references, "References") map("n", "gd", vim.lsp.buf.definition, "Definition") map({ "n", "i" }, "", vim.lsp.buf.hover, "Hover") map("n", "", vim.lsp.buf.rename, "Rename") map({ "n", "i" }, "", vim.lsp.buf.format, "Format") map("n", "ca", vim.lsp.buf.code_action, "Code action") -- Package manager map("n", "l", "Lazy", "Lazy")