🍔English | 🍡日本語 |
---|
To run the following command on NeoVim.
:RunIt
In setup()
, specify a table of extensions and commands to run. Below is a sample.
local function isNodejs()
local packagejson = "package.json"
if vim.fn.findfile(packagejson, "./") == packagejson then
return true
else
return false
end
end
require("runit").setup({
js = function(file)
if isNodejs() then
return "node" .. file
else
return "deno run -A " .. file
end
end,
ts = function(file)
return "deno run -A " .. file
end,
mjs = function()
return "node" .. file
end,
py = function(file)
return "python" .. file
end,
})
You can customize to use other terminal on runit.
require("runit").setup({
mjs = function()
return "node" .. file
end,
py = function(file)
return "python" .. file
end,
}, "Deol")
- dein.vim
[[plugins]]
repo = "https://github.com/Comamoca/runit.nvim"
on_cmd = ["RunIt"]
- dein.vim(toml)
call("dein#add", "https://github.com/Comamoca/runit.nvim")
Clone this repository and edit ./lua/runit.lua
.
- Correspond to command line arguments.
MIT