mirror of https://github.com/Hilbis/Hilbish
feat: add hilbish.vim interface (closes #114)
parent
960909b81d
commit
cb88db8cfc
|
@ -7,6 +7,7 @@ package.path = package.path .. ';' .. hilbish.dataDir .. '/?/init.lua'
|
||||||
require 'nature.commands'
|
require 'nature.commands'
|
||||||
require 'nature.completions'
|
require 'nature.completions'
|
||||||
require 'nature.opts'
|
require 'nature.opts'
|
||||||
|
require 'nature.vim'
|
||||||
|
|
||||||
local shlvl = tonumber(os.getenv 'SHLVL')
|
local shlvl = tonumber(os.getenv 'SHLVL')
|
||||||
if shlvl ~= nil then
|
if shlvl ~= nil then
|
||||||
|
|
|
@ -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
|
||||||
|
})
|
Loading…
Reference in New Issue