Skip to content
Discussion options

You must be logged in to vote

That error message is not from the init.lua you posted (the error is about config being nil when calling config.MakeCommand on line 2, but in your init.lua config is defined and it's not called on line 2).

To run a command on startup you could use the postinit callback and micro.CurPane() to get a handle to current BufPane:

local micro = import("micro")

function postinit()
    local bp = micro.CurPane()
    bp:HandleCommand("vivifyMaybe")
end

But I think what you actually meant is to run it every time you open a file (not just on startup). You could use onBufPaneOpen, but then you won't catch events where you open a different file in the same pane with the open command:

local buffer = im…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tomasriveral
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants