-- Loaded by `null.config` local map = function(modes, key, target, opts) local mt = {} for mode in modes:gmatch"." do table.insert(mt, mode) end vim.keymap.set(mt, key, target, opts or { noremap = true, silent = true, }) end -- Map Ctrl+U as U so it can be used as redo map("n", "", "U") -- Map U as redo map("n", "U", "") -- Yank and Put map("n", "", '"+y') map("n", "", '"+p') map("n", "", '"+y') map("n", "", '"+p') -- Comment a line like how it is on VSC (using vim-commentary) map("n", "", "gcc", { remap = true }) map("v", "", "gc", { remap = true }) map("i", "", "gcc", { remap = true }) -- Normal command shortcut for VISUAL mode map("v", ".", ":normal .")