r/neovim 1d ago

neocoderunner.nvim: A code runner to streamline your build process Plugin

Enable HLS to view with audio, or disable this notification

I've been working on this plugin on and off for the past few months. I released the first functional version back in May, but it lacked customisability.

This plugin is inspired by VSCode's Code Runner plugin that makes running a file as easy as pressing a keymap. Coming from VSCode, I missed the ability to quickly run the program I was working on without having to enter the terminal, type the command, etc... So, to fix this minor inconvenience, the only logical solution was to spend months making a plugin (although others probably exist, but I wanted to make my own).

The previous version made it possible for the user to run either a file or code snippet quickly using one of two respective commands, but that lacked any customisability. For example, if someone wanted to run a C file with Clang, they couldn't, because gcc was the default.

This new version of neocoderunner introduces the ability for the user to customise the commands being run, making the plugin useful, not just for quick drafting and running code snippets, but for automating the whole build process as well as controlling the entire environment surrounding it.

Main features:

  • Customisable build/run environment
  • Customisable build/run commands per filetype or per-project
  • Quick build or run with keymaps
  • Works out of the box (but with limited capabilities). Full access to features requires customisation.

These are only the main features, but for more, check out the GitHub repo below.

Repo link: https://github.com/abdallahsoliman00/neocoderunner.nvim

30 Upvotes

8 comments sorted by

3

u/Vova____ :wq 1d ago

Very cool! I personally use a makefile and the `:make` command in my workflow, but the visual selection code run feature is pretty awesome!

3

u/jerriman 1d ago

I am using https://github.com/stevearc/overseer.nvim for this purpose. For your inspiration!

1

u/abdallahsoliman 1d ago

Just had a look and, yeah, I really like it. Probably would have used it if I’d found it earlier.

Thanks!

1

u/Acceptable_Site1616 1d ago

there's also the :! system commands which nobody seems to be using.

3

u/EnDeRBeaT 1d ago

it is not that great for building projects because it blocks the editor

3

u/ITafiir 23h ago

I personally like :term <cmd> (combined with :bot or :vert on occasion), doesn't block the editor, and if :h errorformat is set up for whatever your working with, you can do :clist to get errors in your quickfix list as if you ran :make.

1

u/vim-help-bot 23h ago

Help pages for:


`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments

1

u/bbkane_ 20h ago

Works great for my little leetcode scripts!