-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
I am trying to get a shebang-plugin to run, no success:
local micro = import("micro")
local config = import("micro/config")
function insertShebang(bp)
local buf = bp.Buf
local success, err = pcall(function()
if buf:LineCount() == 0 then
buf:Insert(1, "#!/usr/bin/env bash\n")
elseif buf:Line(1) ~= "#!/usr/bin/env bash" then
buf:Insert(1, "#!/usr/bin/env bash\n")
else
micro.InfoBar():Message("Shebang already exists.")
end
end)
if not success then
micro.InfoBar():Error("Fehler: " .. err)
end
end
function init()
config.MakeCommand("bang", insertShebang, config.NoComplete)
config.AddRuntimeFile("bang", config.RTHelp, "help/bang.md")
end
Has anyone already a simple Shebang-Plugin up his sleeve?
I also posted at the unofficial channel: https://github.com/Neko-Box-Coder/unofficial-plugin-channel/issues/10
Metadata
Metadata
Assignees
Labels
No labels