move to lua and make a poor man's ide
This commit is contained in:
parent
8017c2ac22
commit
f551318edc
14 changed files with 418 additions and 143 deletions
16
lua/utils/init.lua
Normal file
16
lua/utils/init.lua
Normal 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
|
Reference in a new issue