neovim-cpp-runner
A lightweight plugin that streamlines C++ development in Neovim with one-key compilation and integrated I/O management.
Features
- Single keypress workflow - Press
F5
to instantly compile and run your C++ code - Dedicated I/O panels - Separate panes for inputs and outputs
- Competitive programming friendly - Perfect for quick algorithm testing
- Zero configuration needed - Works out of the box with sensible defaults
- Fully customizable - Adjust layouts, commands, and keybindings to your preference
Installation
-- Packer
use {
'ankit02327/neovim-cpp-runner',
config = function()
require('neovim-cpp-runner').setup()
end
}
-- Lazy.nvim
{
'ankit02327/neovim-cpp-runner',
config = true,
lazy = false,
}
-- vim-plug
Plug 'ankit02327/neovim-cpp-runner'
" After plug#end():
lua require('neovim-cpp-runner').setup()
Configuration (Optional)
require('neovim-cpp-runner').setup({
-- Layout settings
code_width = 0.8, -- 80% width for code
input_height = 0.3, -- 30% height for input
output_height = 0.3, -- 30% height for output
-- File settings
input_file = "input.txt",
output_file = "output.txt",
-- Compilation settings
compile_command = "g++ % -o %< && %< < {input} > {output}",
})
Why I Made This
I created this plugin to simplify my competitive programming workflow in Neovim. Having dedicated input/output panes streamlines testing and debugging algorithms, especially when working with multiple test cases.
No more switching between terminal windows or manually running compilation commands - just write code, press F5, and see results instantly.
Requirements
- Neovim 0.8+
- g++ compiler
Links
- GitHub: https://github.com/ankit02327/neovim-cpp-runner
- Contributions and feedback welcome!