Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/he7086/code-runner.nvim
Simple Code Runner for Neovim
https://github.com/he7086/code-runner.nvim
Last synced: about 2 months ago
JSON representation
Simple Code Runner for Neovim
- Host: GitHub
- URL: https://github.com/he7086/code-runner.nvim
- Owner: HE7086
- License: mit
- Created: 2024-07-16T13:42:40.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-27T16:17:35.000Z (5 months ago)
- Last Synced: 2024-07-27T17:44:39.099Z (5 months ago)
- Language: Lua
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# code-runner.nvim
Simple Code Runner for Neovim* This plugin is designed for quickly running very simple scripts in one click.
* For anything consisting of more than one file this is not suited, use a proper build system instead.## usage
* Lazy.nvim
```lua
{
"HE7086/code-runner.nvim",
cmd = "CodeRunnerRun",
opts = { -- make sure to have this none empty so the plugin could load. E.g. opts = {}
runners = {
-- customize your own runners overriding builtin ones
{ ft = "zsh", runner = "zsh" },
{
ft = "rust",
runner = function()
return string.format(
"rustc %s -o %s && %s; rm -f %s",
vim.fn.expand("%"),
vim.fn.expand("%:r"),
vim.fn.expand("%:p:r"),
vim.fn.expand("%:r")
)
end
},
},
term = function(command)
-- default: use neovim's builtin terminal
vim.api.nvim_command("tabnew | terminal " .. command)-- use akinsho/toggleterm.nvim
-- require("toggleterm").exec(command, nil, nil, nil, nil, "Code Runner")
end,
},
keys = {
{ "", "CodeRunnerRun", desc = "Run Code" },
},
}
```