{"id":13898602,"url":"https://github.com/cdelledonne/vim-cmake","last_synced_at":"2025-07-17T15:34:03.348Z","repository":{"id":40449741,"uuid":"262579426","full_name":"cdelledonne/vim-cmake","owner":"cdelledonne","description":"Vim/Neovim plugin for working with CMake projects","archived":false,"fork":false,"pushed_at":"2024-08-03T12:33:07.000Z","size":204,"stargazers_count":249,"open_issues_count":6,"forks_count":20,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-07T18:46:51.528Z","etag":null,"topics":["cmake","neovim","nvim","vim"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdelledonne.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-09T13:41:16.000Z","updated_at":"2024-08-06T18:11:17.000Z","dependencies_parsed_at":"2024-07-06T10:58:41.772Z","dependency_job_id":null,"html_url":"https://github.com/cdelledonne/vim-cmake","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdelledonne%2Fvim-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdelledonne%2Fvim-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdelledonne%2Fvim-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdelledonne%2Fvim-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdelledonne","download_url":"https://codeload.github.com/cdelledonne/vim-cmake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226274927,"owners_count":17598861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","neovim","nvim","vim"],"created_at":"2024-08-06T18:04:22.273Z","updated_at":"2024-11-25T04:31:48.441Z","avatar_url":"https://github.com/cdelledonne.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"# Vim-CMake\n\nVim-CMake is a plugin for building CMake projects inside of Vim/Neovim, with a\nnice visual feedback.\n\n![tests](https://img.shields.io/github/actions/workflow/status/cdelledonne/vim-cmake/lint.yaml?label=tests)\n![language](https://img.shields.io/github/languages/top/cdelledonne/vim-cmake)\n![version](https://img.shields.io/github/v/tag/cdelledonne/vim-cmake?label=version\u0026sort=semver)\n![license](https://img.shields.io/github/license/cdelledonne/vim-cmake)\n\n![screencast][screencast]\n\n**Features**\n\n* Visual experience, shows CMake output in a console-like window\n* Slick management of build configurations\n* Autocompletion for build targets, configurations, executables and tests\n* Quickfix list population after each build\n* Airline/statusline status information, including current build configuration\n* Plug-and-play, but configurable\n* Written in Vimscript\n\n**Requirements**\n\n* Vim with `+terminal`, or Neovim \u003e= 0.5\n* Under Windows, only Neovim is supported at the moment\n* Target completion uses the `cmake-file-api(7)`, which requires CMake 3.14 or\n  later\n* Running executables also requires the `cmake-file-api(7)`, and thus CMake 3.14\n  or later\n\n\u003c!--=========================================================================--\u003e\n\n## Installation\n\nUse a package manager like [vim-plug][vim-plug]:\n\n```vim\nPlug 'cdelledonne/vim-cmake'\n```\n\nor Vim's native package manager:\n\n```sh\nmkdir -p ~/.vim/pack/plug/start\ncd ~/.vim/pack/plug/start\ngit clone --recurse-submodules https://github.com/cdelledonne/vim-cmake.git\n```\n\n\u003c!--=========================================================================--\u003e\n\n## Usage\n\nRun `:CMakeGenerate` from the top-level CMake source directory to generate a\nbuild system for the project.  Then, run `:CMakeBuild` to build the project.\nThe built files will end up in the binary directory ([out-of-source\nbuild][oos]).  To switch between build configurations, run `:CMakeSwitch\n\u003cconfig\u003e`.  To run executable targets in an overlay window, run `:CMakeRun\n\u003ctarget\u003e`.  To run CMake-generated tests with CTest, run `:CMakeTest`.\n\nWith Vim-CMake, you can easily manage build configurations (Debug, Release,\netc.), build specific targets and control build options, and fix errors using\nVim's quickfix feature.  For a detailed explanation of commands, mappings and\nfunctionalities run `:help cmake`.  A quick overview follows.\n\n\u003c!--=========================================================================--\u003e\n\n## Commands and `\u003cPlug\u003e` mappings\n\n| Command                   | `\u003cPlug\u003e` mapping      | Description                           |\n|:--------------------------|:----------------------|:--------------------------------------|\n| `:CMakeGenerate[!]`       | `(CMakeGenerate)`     | Generate build system                 |\n| `:CMakeClean`             | `(CMakeClean)`        | Remove build system and build files   |\n| `:CMakeBuild[!] [target]` | `(CMakeBuild)`        | Build a project                       |\n| `:CMakeInstall`           | `(CMakeInstall)`      | Install build output                  |\n| `:CMakeRun \u003ctarget\u003e`      | `(CMakeRun)`          | Run executable target                 |\n| `:CMakeTest`              | `(CMakeTest)`         | Run CMake-generated tests with CTest  |\n| `:CMakeSwitch \u003cconfig\u003e`   | `(CMakeSwitch)`       | Switch to another build configuration |\n| `:CMakeOpen`              | `(CMakeOpen)`         | Open CMake console window             |\n| `:CMakeClose[!]`          | `(CMakeClose)`        | Close CMake console window            |\n| `:CMakeToggle`            | `(CMakeToggle)`       | Toggle CMake console window           |\n| `:CMakeCloseOverlay`      | `(CMakeCloseOverlay)` | Close overlay window                  |\n| `:CMakeStop`              | `(CMakeStop)`         | Stop running command                  |\n\n\u003c!--=========================================================================--\u003e\n\n## Additional `\u003cPlug\u003e` mappings\n\n| `\u003cPlug\u003e` mapping     | Behaves as                                            |\n|:---------------------|:------------------------------------------------------|\n| `(CMakeBuildTarget)` | `(CMakeBuild)`, but leaves cursor in the command line |\n\n\u003c!--=========================================================================--\u003e\n\n## Key mappings\n\nMappings in the CMake console window:\n\n| Key mapping | Description                |\n|:------------|:---------------------------|\n| `cg`        | Run `:CMakeGenerate`       |\n| `cb`        | Run `:CMakeBuild`          |\n| `ci`        | Run `:CMakeInstall`        |\n| `ct`        | Run `:CMakeTest`           |\n| `cq`        | Run `:CMakeClose`          |\n| `\u003cC-C\u003e`     | Stop running command       |\n\nMappings in the overlay window:\n\n| Key mapping | Description                |\n|:------------|:---------------------------|\n| `cq`        | Run `:CMakeCloseOverlay`   |\n\n\u003c!--=========================================================================--\u003e\n\n## Events\n\nVim-CMake provides a set of custom events to trigger further actions.  Run\n`:help cmake` for full documentation on all configuration options and examples.\n\n| Event                      | Description                                |\n|:---------------------------|:-------------------------------------------|\n| `User CMakeGeneratePre`    | Triggered before running `:CMakeGenerate`  |\n| `User CMakeBuildPre`       | Triggered before running `:CMakeBuild`     |\n| `User CMakeBuildSucceeded` | Triggered after a successful `:CMakeBuild` |\n| `User CMakeBuildFailed`    | Triggered after a failed `:CMakeBuild`     |\n\n\u003c!--=========================================================================--\u003e\n\n## Quickfix list\n\nAfter each build (e.g. run with `:CMakeBuild`), Vim-CMake populates a quickfix\nlist to speedup the edit-compile-run cycle, similarly to when running `:make` in\nVim/Neovim.  Upon an unsuccessful build, just use the standard quickfix commands\nto open the list of errors (e.g. `:copen`) and jump between errors (e.g.\n`:cfirst`, `:cnext`).\n\n\u003c!--=========================================================================--\u003e\n\n## Configuration\n\nVim-CMake has sensible defaults.  Again, run `:help cmake` for full\ndocumentation on all the configuration options.  A list of default values\nfollows.\n\n| Options                         | Default            |\n|:--------------------------------|:-------------------|\n| `g:cmake_command`               | `'cmake'`          |\n| `g:cmake_test_command`          | `'ctest'`          |\n| `g:cmake_default_config`        | `'Debug'`          |\n| `g:cmake_build_dir_location`    | `'.'`              |\n| `g:cmake_generate_options`      | `[]`               |\n| `g:cmake_build_options`         | `[]`               |\n| `g:cmake_native_build_options`  | `[]`               |\n| `g:cmake_test_options`          | `[]`               |\n| `g:cmake_console_size`          | `15`               |\n| `g:cmake_console_position`      | `'botright'`       |\n| `g:cmake_console_echo_cmd`      | `1`                |\n| `g:cmake_jump`                  | `0`                |\n| `g:cmake_jump_on_completion`    | `0`                |\n| `g:cmake_jump_on_error`         | `1`                |\n| `g:cmake_link_compile_commands` | `0`                |\n| `g:cmake_root_markers`          | `['.git', '.svn']` |\n| `g:cmake_log_file`              | `''`               |\n| `g:cmake_log_level`             | `'INFO'`           |\n| `g:cmake_statusline`            | `0`                |\n| `g:cmake_restore_state`         | `1`                |\n| `g:cmake_reinit_on_dir_changed` | `1`                |\n\n\u003c!--=========================================================================--\u003e\n\n## Public API\n\nVim-CMake provides a public API to query information about the CMake environment\nas well as plugin state.  The public API consists of a single function\n`cmake#GetInfo()` which returns a dictionary containing the information.  For\nextensive information run `:help cmake-api`.\n\nTo show the CMake version in your statusline you could do:\n```vim\nset statusline=%{cmake#GetInfo().cmake_version.string}\n```\nor integrate this as a component in your preferred statusline plugin.\n\n\u003c!--=========================================================================--\u003e\n\n## Contributing\n\nFeedback and feature requests are appreciated.  Bug reports and pull requests\nare very welcome.  Check the [Contributing Guidelines][contributing] for how to\nwrite a feature request, post an issue or submit a pull request.\n\n\u003c!--=========================================================================--\u003e\n\n## License\n\nVim-CMake is licensed under the [MIT license][license].  Copyright (c)\n2020\u0026ndash;2024 Carlo Delle Donne.\n\n\u003c!--=========================================================================--\u003e\n\n[screencast]: https://user-images.githubusercontent.com/24732205/88468329-18aad100-cee2-11ea-94f4-f2ac59a2e6b9.gif\n[vim-cmake]: https://github.com/vhdirk/vim-cmake\n[cmake4vim]: https://github.com/ilyachur/cmake4vim\n[cmake.vim]: https://github.com/jalcine/cmake.vim\n[vim-cmake-project]: https://github.com/sigidagi/vim-cmake-project\n[LucHermitte/vim-build-tools-wrapper]: https://github.com/LucHermitte/vim-build-tools-wrapper\n[neoterm]: https://github.com/kassio/neoterm\n[vim-plug]: https://github.com/junegunn/vim-plug\n[oos]: https://cprieto.com/posts/2016/10/cmake-out-of-source-build.html\n[contributing]: ./CONTRIBUTING.md\n[license]: ./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdelledonne%2Fvim-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdelledonne%2Fvim-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdelledonne%2Fvim-cmake/lists"}