feat: add hilbish.vim interface (closes #114)

fg-job
TorchedSammy 2022-05-13 20:52:48 -04:00
parent 960909b81d
commit cb88db8cfc
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
2 changed files with 20 additions and 0 deletions

View File

@ -7,6 +7,7 @@ package.path = package.path .. ';' .. hilbish.dataDir .. '/?/init.lua'
require 'nature.commands'
require 'nature.completions'
require 'nature.opts'
require 'nature.vim'
local shlvl = tonumber(os.getenv 'SHLVL')
if shlvl ~= nil then

19
nature/vim.lua 100644
View File

@ -0,0 +1,19 @@
local vim = {}
hilbish.vim = {
registers = {}
}
setmetatable(hilbish.vim.registers, {
__newindex = function(_, k, v)
hilbish.editor.setVimRegister(k, v)
end,
__index = function(_, k)
return hilbish.editor.getVimRegister(k)
end
})
setmetatable(hilbish.vim, {
__index = function(_, k)
if k == 'mode' then return hilbish.vimMode end
end
})