A simple Neovim plugin to streamline your CMake workflow.
- Run CMake generate, build, and install commands from inside Neovim.
- Reads configuration from a JSON file (
.easy-cmake/config.json) in your project root. - Customizable CMake executable, generator, build directory, and variables.
Use your favorite plugin manager.
With lazy.nvim:
{
'DivAgarwal1/easy-cmake.nvim',
opts = {}
}Create a .easy-cmake/config.json file in your project root.
Example:
{
"cmakeExe": "cmake",
"generator": "Unix Makefiles",
"buildDirectory": "build",
"variables": {
"CMAKE_BUILD_TYPE": "Debug",
"MY_CUSTOM_VAR": "foo"
}
}If no .easy-cmake/config.json is provided, or if a field is left blank, the plugin uses:
{
"cmakeExe": "cmake",
"generator": "Unix Makefiles",
"buildDirectory": "build",
"variables": {}
}You can choose to fill in only the fields you find necessary.
The plugin creates the following commands:
:CMakeGenerate— Run CMake generate step.:CMakeBuild— Build the project.:CMakeInstall— Install the project.
- Create or update
.easy-cmake/config.jsonas needed. - Inside Neovim, run
:CMakeGenerateto configure your project. - Run
:CMakeBuildto build. - Run
:CMakeInstallto install.
MIT
Pull requests and feedback are welcome!