repositories / dotfiles
dotfiles
bugabingas dorkfiles
owned by bugabinga
neovim/lua/bugabinga/pivi/runtime.lua
Raw--- Locates the assets pivi ships and the address a child needs to reach back.
--- Everything here is additive: pivi adds its companion extension and its skill
--- to the user's own Pi, and never removes what the user configured.
local runtime_file = function( relative )
local found = vim.api.nvim_get_runtime_file( relative, false )[1]
if found then return vim.fs.normalize( found ) end
return nil
end
local extension_path = function()
return runtime_file 'lua/bugabinga/pivi/extension/index.ts'
end
local client_path = function()
return runtime_file 'lua/bugabinga/pivi/extension/client.lua'
end
local skill_path = function()
return runtime_file 'lua/bugabinga/pivi/skills/pivi/SKILL.md'
end
--- Environment the companion extension needs to reach this Neovim instance.
local bridge_environment = function()
local address = vim.v.servername
if address == nil or address == '' then return nil end
return {
PIVI_NVIM_ADDRESS = address,
PIVI_NVIM_EXE = vim.v.progpath,
PIVI_NVIM_CLIENT = client_path(),
}
end
return {
file = runtime_file,
extension_path = extension_path,
client_path = client_path,
skill_path = skill_path,
bridge_environment = bridge_environment,
}