https://github.com/grecodavide/coderunner.nvim
Run code in neovim
https://github.com/grecodavide/coderunner.nvim
lua neovim nvim
Last synced: about 1 month ago
JSON representation
Run code in neovim
- Host: GitHub
- URL: https://github.com/grecodavide/coderunner.nvim
- Owner: grecodavide
- License: mit
- Created: 2022-02-24T18:45:08.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-12T20:31:36.000Z (over 3 years ago)
- Last Synced: 2025-07-24T01:45:19.319Z (11 months ago)
- Topics: lua, neovim, nvim
- Language: Lua
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# coderunner.nvim
Run code in neovim's integrated terminal
# Requirements
This plugin requires neovim >= 0.6
# Setup
to set up this plugin, in a lua file require it and give it the commands:
```lua
local cr = require("coderunner")
cr.commands = {
sh = "${FP}",
py = "python ${FP}"
-- note that this is a shell command, so it can be something more elaborate
c = "gcc -o ${N} ${FP};if [[ $? ]];then ${N}; fi"
}
```
Available placeholders are:
- `${FP}` for the full path
- `${NE}` for the file name
- `${N}` for the file name without extension
# Features
Run current file in a neovim terminal.
The available functions are:
- `run_current`
- `run_file` (requires filepath)
And the commands to do the same are:
- `RunCurrent`
- `RunFile`
Note that you can create a split like so:
- `:split | RunCurrent`
- `:vsplit | RunCurrent`