- Notifications
You must be signed in to change notification settings - Fork1
bhushan/coderunner.nvim
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A modern, extensible code execution plugin for Neovim supporting 30+ languages with multiple execution strategies.
- 30+ Languages: JavaScript, Python, PHP, Go, Rust, C/C++, Java, and more
- Smart Execution: Auto-detects optimal execution strategy per language
- Optional Snacks.nvim: Falls back to native floating terminal
- Modular Architecture: Easy to extend and customize
- Custom Commands: Run with user-defined commands
Usinglazy.nvim
{"bhushan/coderunner.nvim",dependencies= {"folke/snacks.nvim",-- Optional },config=function()require("coderunner").setup({-- Configuration options })end,keys= { {"<leader>x","<cmd>CodeRun<cr>",desc="Run Code"}, {"<leader>X","<cmd>CodeRunCustom<cr>",desc="Run Code (Custom)"}, {"<leader>xl","<cmd>CodeRunList<cr>",desc="List Languages"}, },}Usingpacker.nvim
use {"bhushan/coderunner.nvim",requires= {"folke/snacks.nvim"},-- Optionalconfig=function()require("coderunner").setup()end}
require("coderunner").setup({-- Use Snacks.nvim if availableuse_snacks=true,-- Terminal window configurationwindow= {width=0.8,height=0.8,border="rounded", },-- Auto-save before executionauto_save=true,-- Custom language configurationslanguages= {-- Override or add new languagespython= {cmd="python3 %",description="Python execution", }, },})
<leader>x- Run current file<leader>X- Run with custom command<leader>xl- List supported languages
:CodeRun- Execute current file:CodeRunCustom- Execute with custom command input:CodeRunList- Show all supported languages
| Language | Execution | Icon |
|---|---|---|
| JavaScript | Terminal | |
| TypeScript | Terminal | |
| Python | Terminal | |
| PHP | Terminal | |
| Go | Terminal | |
| Rust | Terminal | |
| C/C++ | Build+Run | |
| Java | Build+Run | |
| Lua | Inline | |
| And 20+ more... |
localcoderunner=require("coderunner")-- Run current buffercoderunner.run_code()-- Run with custom commandcoderunner.run_code_with_input()-- Add language supportcoderunner.add_language("mylang", {cmd="mylang %",strategy="terminal",description="My Language execution",})-- Get supported languageslocallangs=coderunner.get_supported_languages()
coderunner.nvim/├── lua/│ └── coderunner/│ ├── init.lua # Main entry point│ ├── config.lua # Configuration management│ ├── languages.lua # Language definitions│ ├── executor.lua # Execution logic│ ├── ui.lua # UI components│ └── terminal.lua # Terminal abstraction├── plugin/│ └── coderunner.vim # Vim commands└── README.md- Neovim >= 0.9.0
- Language-specific compilers/interpreters installed
- Optional: Snacks.nvim for enhanced terminal experience
MIT
About
No description, website, or topics provided.
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published