refactor(nvim): Move functions to null.util

This commit is contained in:
Ahmad Ansori Palembani 2024-04-17 11:08:14 +07:00
parent 0261c07d0a
commit 06ec5fcda4
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
3 changed files with 36 additions and 27 deletions

View file

@ -1,16 +1,5 @@
-- 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
local map = require("null.util").map
-- Map Ctrl+U as U so it can be used as redo
map("n", "<C-u>", "U")