This commit is contained in:
Mike 2023-07-31 10:50:08 +03:00
commit b13f4b53ff
3 changed files with 54 additions and 0 deletions

6
bindings.json Normal file
View File

@ -0,0 +1,6 @@
{
"Alt-/": "lua:comment.comment",
"Alt-l": "lua:initlua.ixio",
"CtrlR": "lua:initlua.runme",
"CtrlUnderscore": "lua:comment.comment"
}

29
init.lua Normal file
View File

@ -0,0 +1,29 @@
local config = import("micro/config")
local shell = import("micro/shell")
function runme(bp)
local buf = bp.Buf -- The current buffer
buf:Save()
if buf:FileType() == "python" then
shell.RunInteractiveShell("python3 " .. buf.Path, true, false)
elseif buf:FileType() == "myrddin" then
shell.RunInteractiveShell("mbld -R " .. buf.Path, true, false)
elseif buf:FileType() == "picolisp" then
shell.RunInteractiveShell("pil " .. buf.Path .. " +", true, false)
elseif buf:FileType() == "verifpal" then
shell.RunInteractiveShell("verifpal verify " .. buf.Path, true, false)
elseif buf:FileType() == "ruby" then
shell.RunInteractiveShell("ruby " .. buf.Path, true, false)
elseif buf:FileType() == "d" then
shell.RunInteractiveShell("dmd -run " .. buf.Path, true, false)
end
end
function ixio(bp)
local buf = bp.Buf
buf:Save()
shell.RunInteractiveShell("curl -F 'f=@" .. buf.Path .. "' pb1n.de", true, false)
end
function init()
config.TryBindKey("CtrlR", "lua:initlua.runme", true)
config.TryBindKey("Alt-l", "lua:initlua.ixio", true)
end

19
settings.json Normal file
View File

@ -0,0 +1,19 @@
{
"*.l": {
"autoclose": false,
"autoident": true,
"filetype": "picolisp",
"matchbrace": true,
"matchbraceleft": true,
"tabsize": 3,
"tabstospaces": true
},
"*.vp": {
"commenttype": "// %s",
"filetype": "verifpal"
},
"autoclose": false,
"cursorline": false,
"rmtrailingws": true,
"ruler": false
}