Skip to content

Separate command line for textfilter #3638

Answered by Andriamanitra
mihaon asked this question in Q&A
Discussion options

You must be logged in to vote

The easiest way is probably to wrap textfilter command in another command like this:

~/.config/micro/init.lua

local micro = import("micro")
local config = import("micro/config")

function init()
    config.MakeCommand(
        "prompt-textfilter",
        function (bufpane)
            local callback = function (resp, canceled)
                if not canceled and resp ~= "" then
                    bufpane:HandleCommand(string.format("textfilter sh -c '%s'", resp))
                end
            end
            micro.InfoBar():Prompt("|> ", "", "Textfilter", nil, callback)
        end,
        config.NoComplete
    )
end

~/.config/micro/bindings.json

{
    "Ctrl-b": "command:prompt-textf…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mihaon
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