Skip to content
Discussion options

You must be logged in to vote

I don't see the action package documented in the plugin readme, is it just not exposed to plugins?

The action package is not exported. NewTabFromBuffer is not accessible from Lua, and there is no intended way to create a new tab directly. You can create one through func (h *BufPane) NewTabCmd(args []string).

local config = import("micro/config")

function init()
    config.MakeCommand("createTab", createTabCommand, config.NoComplete)
end

function createTabCommand(bp)
    bp:NewTabCmd({"/home/jordo/test.md"})
end

I’m not sure what your final goal is. If you just want to create a tab from a filepath, there’s already the command tab [filepath]. If you want to bind it to a key, you can do …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jordanbaron
Comment options

Answer selected by jordanbaron
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