You must add the following code to your init.lua:
local buffer = import("micro/buffer")
local shell = import("micro/shell")
function vivifyOpen(buf)
local cursor = buf:GetActiveCursor()
local line = cursor.Loc.Y + 1
shell.ExecCommand("viv", string.format("%s:%d", buf.AbsPath, line))
end
function onBufferOpen(buf)
if os.getenv("MICRO_VIVIFY") ~= "1" then
return
end
if buf.Type.Kind == buffer.BTDefault then
vivifyOpen(buf)
end
endThis enables Vivify to run automatically when a file is opened, effectively simulating “startup” behavior (since Micro does not provide a true startup command hook for this use case).
Big thanks to @Andriamanitra for answering my questions.