This repository has been archived on 2024-10-06. You can view files and clone it, but cannot push or open issues or pull requests.
neovim/lua/utils.lua

17 lines
429 B
Lua
Raw Normal View History

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)
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