A blazing-fast Neovim code runner plugin for executing code snippets directly from your editor.
- Multi-language support: C++, JavaScript, Python
- Smart selection: Runs the code block you heroically selected, or just bulldozes through the whole buffer if you forgot to select anything. Because who needs precision anyway?
- Beautiful UI: Output floating window with mesmerizing markdown rendering
- Asynchronous execution: Non-blocking code execution
- Clean: Just forget about temp file storage, you're sorted!
The interpreters/executables must be available on your path.
- Neovim >= 0.8.0
- Node.js (for JavaScript)
- Python (for Python)
- Cling - C++ interpreter for REPL-like experience
> Installation methods may vary by platform. For the most accurate and up-to-date instructions, please refer to the official sources:
> https://root.cern/install/
Using lazy.nvim
{
'jignesh119/FlashRunner.nvim',
config = function()
require('FlashRunner').setup()
end
}Using packer.nvim
use {
'jignesh119/FlashRunner.nvim',
config = function()
require('FlashRunner').setup()
end
}Using vim-plug
Plug 'jignesh119/FlashRunner.nvim'Then add to your init.lua:
require('FlashRunner').setup()require('FlashRunner').setup({
keymap = "<leader>Fr", -- Default keymap for visual mode execution
})- Select code in visual mode (
v,V, orCtrl+v) - Press the keymap (default:
<leader>Fr) - View results in the floating window
- Press
qto close the output window
:FlashRunnerShow-
Clone the repository:
git clone https://github.com/jignesh119/FlashRunner.nvim.git cd FlashRunner.nvim -
Make the shell script executable:
chmod +x lua/FlashRunner/cling-runner.sh
-
Install development dependencies:
# Install required interpreters sudo apt-get install nodejs python3 cling # Ubuntu/Debian # OR brew install node python cling # macOS
-
Link/Register plugin for development: you can load the plugin from a local directory using your plugin manager.
Using lazy.nvim
return {
dir = "/absolute/path/to/FlashRunner.nvim",
config = function()
require("FlashRunner").setup()
end,
}then sync to install/ register the plugin in neovim
:Lazy syncthen upon each update you may want to reload plugin
:Lazy reload FlashRunnerFollow this Blog post to understand how to build your neovim own plugin Dev.to step-by-step guide
-
"No valid executor for this language"
- We currently support C++, JavaScript, Python
- Ensure the file has the correct filetype (
:set filetype?) - Verify language support in
selection.lua
-
C++ execution fails
- Install Cling interpreter
- Check if
cling-runner.shis executable - Verify the script path in configuration
-
JavaScript/Python execution fails
- Ensure Node.js/Python is installed and in PATH
- Test with
node --versionorpython --version
-
Floating window doesn't appear
- Check for errors with
:messages - Ensure Neovim version >= 0.8.0
- Check for errors with
- RPC Integration: Handle interpretation in different programming languages
- TypeScript Support: Add ts-node executor
- More Languages: Rust, Go, Lua, PHP support
- Configuration UI: Interactive setup and language configuration
- Execution History: Save and replay previous executions
- Custom Executors: User-defined execution commands
- Integration: LSP integration for better error reporting
- Heavily inspired by none other than teej (nvim gawd)
P.S AI assited in writing this readme