Git Product home page Git Product logo

quick-code-runner.nvim's Introduction

Welcome to quick-code-runner.nvim ๐Ÿ‘‹

Efficient Neovim plugin for running code quickly and simply.

IT Man - Introducing quick-code-runner.nvim - A simple and efficient code runner for Neovim

Features

  • Efficient Code Execution: Run code snippets swiftly in Neovim.
  • Support for Multiple Languages: Currently supports JavaScript, TypeScript, Python, and Go.
  • Easy Customization: Configurable to suit your coding style and requirements.
  • Simple Installation: Quick setup with lazy.nvim.

Installation

Add the following to your Neovim configuration to install quick-code-runner.nvim:

Install with lazy.nvim

{
    "jellydn/quick-code-runner.nvim",
    dependencies = { "MunifTanjim/nui.nvim" },
    opts = {
      debug = true,
    },
    cmd = { "QuickCodeRunner", "QuickCodePad" },
    keys = {
      {
        "<leader>cr",
        ":QuickCodeRunner<CR>",
        desc = "Quick Code Runner",
        mode = "v",
      },
      {
        "<leader>cp",
        ":QuickCodePad<CR>",
        desc = "Quick Code Pad",
      },
    },
  }

Configuration

Customize the plugin by modifying the default configuration. Example:

--- Default configuration for quick-code-runner.nvim
local default_config = {
  debug = false, -- Print debug information
  file_types = {
    javascript = { 'bun run' }, -- Run command for javascript, you can change to `node` or `deno`
    typescript = { 'bun run' }, -- Run command for typescript, you can change to `npx tsx run` or `deno`
    python = {
      'python3 -u', -- Run command for python
    },
    go = {
      "go run",
    },
  },
}

Usage

  • QuickCodePad: A tool for writing code snippets in a floating window.
  • QuickCodeRunner: Run selected code snippets using <leader>cr.

QuickCodePad

The QuickCodePad is a tool designed for writing and running code snippets swiftly. It opens a floating window, providing a convenient environment for coding and testing.

QuickCodePad

After closing the floating window, run :QuickCodeRunner to execute your code.

This feature is particularly useful when you need a quick, isolated environment for writing and testing code, which you can then run the code by press Enter:

Run code

Running Selected Code

The QuickCodeRunner feature allows you to select a code snippet and run it with ease. You can invoke this feature using the keyboard shortcut <leader>cr.

QuickCodeRunner

Note

The global code block is always executed first, followed by the selected code.

Limitations

Currently optimized for JavaScript, TypeScript, Go, and Python. May work with other languages, but full compatibility is not guaranteed.

Contributing

If you wish to support more languages, feel free to open a Pull Request. We appreciate any contributions to expand the capabilities of quick-code-runner.nvim.

Credits

Drawing inspiration from the feature-rich code_runner.nvim, I aim to create a more simple and efficient alternative.

Alternative solutions

While quick-code-runner.nvim offers an efficient and simple way to run code in Neovim, other plugins might cater to different requirements or preferences. Here are a few noteworthy alternatives:

Author

๐Ÿ‘ค Huynh Duc Dung

Show your support

If this guide has been helpful, please give it a โญ๏ธ.

kofi paypal buymeacoffee

quick-code-runner.nvim's People

Contributors

github-actions[bot] avatar jellydn avatar renovate[bot] avatar sweep-ai[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

quick-code-runner.nvim's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • JohnnyMorganz/stylua-action v4
  • actions/checkout v4
  • stefanzweifel/git-auto-commit-action v5
  • actions/checkout v4
  • rhysd/action-setup-vim v1
  • leafo/gh-actions-lua v10
  • leafo/gh-actions-luarocks v4

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.