move to lua and make a poor man's ide

This commit is contained in:
Vladan Popovic 2021-11-25 22:10:31 +01:00
parent 8017c2ac22
commit f551318edc
No known key found for this signature in database
GPG key ID: 39762748EB5A39D9
14 changed files with 418 additions and 143 deletions

16
lua/utils/init.lua Normal file
View file

@ -0,0 +1,16 @@
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}
if opts then options = vim.tbl_extend('force', options, opts) end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end
return utils