code-playground.mp4
code-playground.nvim is a simple yet powerful Neovim plugin that allows you to run code in the language of your choosing directly within Neovim. When invoked, it opens a buffer in the selected language where you can type your code. Upon saving the buffer, the plugin automatically runs your code and displays the output.
Currently, the plugin supports the following languages:
- .NET (C#)
- TypeScript
- Rust
- Zig
- Python
- Java
- F#
- Go
- Odin
- Haskell
More languages will be supported in future updates!
- Language Selection: Easily choose between supported languages to run your code.
- Automatic Execution: Code is automatically executed upon saving the buffer.
- Real-time Feedback: The output of your code is displayed immediately after execution.
- Extensible: More languages will be supported in the future.
-- lazy.nvim
{
"GustavEikaas/code-playground.nvim",
config = function()
require("code-playground").setup()
end
}
To run code in a specific language:
-
Open the command prompt in Neovim by pressing
:
.:Code <language>
For example, to run C# code, use:
:Code dotnet
-
A new buffer will open. Type your code in this buffer.
-
Save the buffer using
:w
orCtrl+s
. The plugin will automatically execute your code, and the output will be displayed.
-
To run C# (.NET) code:
Code dotnet Code typescript Code rust Code zig Code python Code java Code go Code fsharp Code odin Code haskell
The plugin is designed to work out of the box without requiring additional configuration. However you will still need to have the languages installed
Contributions are welcome! If you want to add a new feature or language support, please fork the repository and create a pull request.
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature-name
. - Commit your changes:
git commit -am 'Add new feature'
. - Push to the branch:
git push origin feature-name
. - Open a pull request.
This plugin is licensed under the MIT License. See the LICENSE file for more details.