Replies: 6 comments 2 replies
-
I think it would be a function like this: local micro = import('micro')
local config = import('micro/config')
local shell = import('micro/shell')
function init()
config.MakeCommand('printraw', function(bp)
-- bp.Buf.AbsPath
local cmd = 'lp -o sides=two-sided-long-edge -o cpi=14 -o lpi=7 -o orientation-requested=3'
local _, err = shell.RunCommand(cmd)
if err ~= nil then
micro.InfoBar():Error(err)
end
end, config.NoComplete)
config.TryBindKey('Ctrl-p', 'command:printraw', true) -- overwrite
end |
Beta Was this translation helpful? Give feedback.
-
Thx taconi for the input! I tried it in two ways: This function in an ~/.config/micro/init.lua and as a second try in ~/.config/micro/plug/printraw/printraw.lua. The keybinding was automatically recognized in the bindings.json, but when trying to print via shortcut it exited with Status 1. |
Beta Was this translation helpful? Give feedback.
-
Perhaps using the
|
Beta Was this translation helpful? Give feedback.
-
Tried it out now, this quits micro immediately. But as my workflow changed a little bit, it's not longer that important for me. I was just surprised, that there is not already a Printer-Plugin or something like that. Thank you anyways. |
Beta Was this translation helpful? Give feedback.
-
With Printer-Plugin I meant something like your function. But working. I don't know, if the mistake is at my side - did you try your function? |
Beta Was this translation helpful? Give feedback.
-
Thank you taconi, sorry for my late anwer. The thing is, at the moment I don't find the time, to follow my "printingwish" for micro, so I will let it go and close it as outdated. |
Beta Was this translation helpful? Give feedback.
-
I would like to be able to print the actual file/saved buffer right out of Micro through the following shell-command:
I just don't get it to work, even with the example of init.lua in the micro-tutorial.
It works via the shellmode in Micro but I would always have to insert the whole command + the whole /path/to/file.
But I would like to press just i.e. ctr+p and then the actual file gets printed.
Anyone to help me out?
Beta Was this translation helpful? Give feedback.
All reactions