2021-11-25 22:10:31 +01:00
|
|
|
local utils = { }
|
|
|
|
|
|
|
|
local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
|
|
|
|
|
|
|
|
function utils.opt(scope, key, value)
|
|
|
|
scopes[scope][key] = value
|
|
|
|
if scope ~= 'o' then scopes['o'][key] = value end
|
|
|
|
end
|
|
|
|
|
|
|
|
function utils.map(mode, lhs, rhs, opts)
|
2023-07-30 04:26:25 +02:00
|
|
|
local options = { noremap = true, silent = true }
|
2021-11-25 22:10:31 +01:00
|
|
|
if opts then options = vim.tbl_extend('force', options, opts) end
|
|
|
|
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
|
|
|
end
|
|
|
|
|
|
|
|
return utils
|