dotfiles/lua/utils.lua
Vladan Popovic 721bc03588 huge refactor
- tidy up
- shuffle code around
- use same abstractions for all usecases
2023-07-30 04:26:44 +02:00

16 lines
429 B
Lua

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)
local options = { noremap = true, silent = true }
if opts then options = vim.tbl_extend('force', options, opts) end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end
return utils