local map = function(mode, lhs, rhs, info) vim.keymap.set(mode, lhs, rhs, { desc = info }) end -- Basics map("n", ";", ":", "Command mode") map({ "i", "n" }, "", "noh", "Clear search") map({ "i", "n", "s", "v" }, "", "w", "Save file") map("n", "U", "redo", "Redo") map("n", "", "enew", "New File") map("n", "", ":%s///g", "Replace word under cursor") map("n", "", "qa", "Quit all") 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", "gd", vim.lsp.buf.definition, "Go to definition") map("n", "gr", vim.lsp.buf.references, "Go to references") map("n", "cf", vim.lsp.buf.format, "Format") -- Plugins map("n", "t", "NvimTreeToggle", "Toggle tree") map("n", "l", "Lazy", "Lazy")