runpad.nvim is a Neovim plugin that provides a flexible runpad buffer for quick code evaluation and experimentation. It supports multiple programming languages and allows you to create, evaluate, and manage runpad buffers easily.
Thank you for considering supporting this project! Your generosity helps keep development active and ensures the plugin continues to improve.
- Create a new runpad buffer for supported filetypes (Lua, Python, R, JavaScript).
- Evaluate the content of the runpad buffer.
- Clear or close the runpad buffer.
- Toggle a default runpad buffer.
Use Lazy.nvim to install runpad.nvim. Add the following to your Lazy.nvim configuration:
{
'walkingshamrock/runpad.nvim',
config = function()
-- Optional: Add any plugin-specific configuration here
end
}You can customize the supported filetypes and evaluators by using the setup function in your Neovim configuration. For example:
require('runpad').setup({
evaluators = {
ruby = function(content)
local handle = io.popen("ruby -e \"" .. content:gsub("\\", "\\\\"):gsub("\"", "\\\"") .. "\"")
local result = handle:read("*a")
handle:close()
return (result or ""):gsub("%s+$", "")
end,
},
})This allows you to add support for additional languages and define custom evaluators for them. The RunpadOpen command will automatically include these filetypes in its autocompletion list.
:RunpadOpen <filetype>: Open a new runpad buffer with the specified filetype.:RunpadEval: Evaluate the content of the current runpad buffer.:RunpadClear: Clear the content of the current runpad buffer.:RunpadClose: Close the current runpad buffer.:RunpadToggle: Toggle the visibility of the default runpad buffer.
-
Open a runpad buffer for a specific filetype:
:RunpadOpen lua -
Write some code in the buffer and evaluate it:
:RunpadEval
-
Clear or close the buffer when done:
:RunpadClear :RunpadClose
This project is licensed under the MIT License. See the LICENSE file for details.