local function map(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({"n", "v"}, "q", "qa!", "Quit all") -- Buffer management map("n", "", "enew", "New file") map({ "i", "n", "s", "v" }, "", "w", "Save file") map("n", "", "bd", "Delete buffer") -- Copy and paste map("v", "", "y") map("n", "", '"+P') -- Editing lines map({ "n", "v" }, "", "^", "Beginning of line") map("i", "", "^i", "Beginning of line") map({ "i", "n", "v" }, "", "", "End of line") map("n", "", "^Da", "Rewrite line") map("i", "", "^Da", "Rewrite line") map("v", "", "V", "Select line") map("n", "", "i", "Split line") map({"n", "v"}, "", "ggVG", "Select all") -- Editing multiple instances map("n", "", "*#", "Search word under cursor") map("v", "", "y/\"N", "Search selection") map("n", "", "viw", "Select word under cursor") map("v", "", "y/\"N", "Search selection") map("n", "", "*#:%s///g", "Replace word under cursor") map("v", "", "y/\"N:%s//\"/g", "Replace selection") -- Editing words map("n", "", "ciw", "Rewrite word") map("n", "", "ToggleWord", "Toggle word") -- Indenting map("n", "", "V>gv") map("n", "", "V") map("v", "", ">gv") map("v", "", "", "Increase number") map("n", "-", "", "Decrease number") map("n", "", "", "Increase number") map("n", "", "", "Decrease number") -- Package manager map("n", "l", "Lazy", "Lazy") -- Redo map("n", "U", "redo", "Redo") -- Shift arrow selection map("n", "", "v") map("n", "", "v") map("n", "", "v") map("n", "", "v") map("v", "", "") map("v", "", "") map("v", "", "") map("v", "", "") map("i", "", "v") map("i", "", "v") map("i", "", "v") map("i", "", "v")