Skip to content

walkingshamrock/runpad.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

runpad.nvim

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.

Buy Me A Coffee

Features

  • 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.

Installation

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
}

Configuration

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.

Commands

  • :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.

Usage

  1. Open a runpad buffer for a specific filetype:

    :RunpadOpen lua
  2. Write some code in the buffer and evaluate it:

    :RunpadEval
  3. Clear or close the buffer when done:

    :RunpadClear
    :RunpadClose

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages