neovim-cpp-runner - Compile/Run C++ with F5 and I/O support

neovim-cpp-runner

A lightweight plugin that streamlines C++ development in Neovim with one-key compilation and integrated I/O management.

:sparkles: 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

:package: 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()

:gear: 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}",
})

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

:clipboard: Requirements

  • Neovim 0.8+
  • g++ compiler

:link: Links

Just out of interest, it looks like the post was generated by an LLM. They all look the same-ish, and this I tend to ignore them as why should I spend time reading it if the “author” didn’t actually write it. Not saying you did use an LLM, just that the post looks like LLM output.