local function map(mode, lhs, rhs, info) vim.keymap.set(mode, lhs, rhs, { desc = info }) end map("n", ";", ":", "Command mode") map("n", "U", "redo", "Redo") map("n", "", "ToggleWord", "Toggle word") map("n", "", "close", "Close window") map("n", "l", "Lazy", "Lazy") map({"n", "v"}, "q", "qa!", "Quit all") map({"n", "i"}, "", "noh", "Clear search") map({"n", "i", "s", "v"}, "", "w", "Save file") -- Editing multiple instances map("n", "", "*#:%s///g", "Replace word under cursor") map("v", "", "y/\"N:%s//\"/g", "Replace selection") map("n", "", "#*", "Search word under cursor") map("v", "", "y/\"N", "Search selection") -- Line movement map({"n", "v"}, "", "^", "Beginning of line") map("i", "", "^i", "Beginning of line") map({"i", "n", "v"}, "", "", "End of line") -- Increasing and decreasing numbers map("n", "+", "", "Increase number") map("n", "-", "", "Decrease number") map("n", "", "", "Increase number") map("n", "", "", "Decrease number") -- Indenting map("n", "", "V>gv") map("n", "", "V") map("v", "", ">gv") map("v", "", "", "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") -- Window switching map("n", "", "k", "Move to the window above") map("n", "", "j", "Move to the window below") map("n", "", "h", "Move to the window on the left") map("n", "", "l", "Move to the window on the right")