added micro settings

This commit is contained in:
tomit4 2021-09-27 11:16:00 -07:00
parent 104f366736
commit 83cfcb5745
27 changed files with 1963 additions and 0 deletions

1
micro/plug/fzf/README.md Normal file
View file

@ -0,0 +1 @@
Provides a `fzf` command in micro to open a file in the current pane using fzf.

38
micro/plug/fzf/main.lua Normal file
View file

@ -0,0 +1,38 @@
VERSION = "1.1.1"
local micro = import("micro")
local shell = import("micro/shell")
local config = import("micro/config")
local buffer = import("micro/buffer")
function fzf(bp)
if shell.TermEmuSupported then
local err = shell.RunTermEmulator(bp, "fzf", false, true, fzfOutput, {bp})
if err ~= nil then
micro.InfoBar():Error(err)
end
else
local output, err = shell.RunInteractiveShell("fzf", false, true)
if err ~= nil then
micro.InfoBar():Error(err)
else
fzfOutput(output, {bp})
end
end
end
function fzfOutput(output, args)
local bp = args[1]
local strings = import("strings")
output = strings.TrimSpace(output)
if output ~= "" then
local buf, err = buffer.NewBufferFromFile(output)
if err == nil then
bp:OpenBuffer(buf)
end
end
end
function init()
config.MakeCommand("fzf", fzf, config.NoComplete)
end

32
micro/plug/fzf/repo.json Normal file
View file

@ -0,0 +1,32 @@
[
{
"Name": "fzf",
"Description": "adds support to opening files via fzf",
"Website": "https://github.com/samdmarshall/micro-fzf-plugin",
"Tags": ["fzf"],
"Versions": [
{
"Version": "1.1.1",
"Url": "https://github.com/micro-editor/updated-plugins/releases/download/v1.0.0/fzf-1.1.1.zip",
"Require": {
"micro": ">=2.0.0-1"
}
},
{
"Version": "1.1.0",
"Url": "https://github.com/micro-editor/updated-plugins/releases/download/v1.0.0/fzf-1.1.0.zip",
"Require": {
"micro": ">=2.0.0-1"
}
},
{
"Version": "1.0.5",
"Url": "https://github.com/samdmarshall/micro-fzf-plugin/archive/v1.0.5.zip",
"Require": {
"micro": ">=1.1.2"
}
}
]
}
]