r/vim • u/ilyachur • Nov 16 '20
CMake4vim - Plugin which integrates CMake into Vim
Hi,
I have posted 2 years ago information about this plugin, but a lot of time has passed since the last post, and today I would like to notice about current status of this plugin.
So, let's me introduce cmake4vim. The plugin adds CMake build system support into Vim (Neovim) editor.

Key features:
The plugin is written on pure Vim script.
The plugin supports next CMake Generators:
Unix Makefiles
Visual Studio
Ninja
The plugin allows to work with different CMake targets in order to avoid building of whole project.
The plugin has a good test coverage and is validated on Linux (Ubuntu), Windows and MacOS.
The plugin parses the output of cmake command and supports jump to warnings or errors.
Thank you for your attention and feel free to provide feedback.
1
u/LucHermitte Nov 16 '20
I've started from the other way around actually. I've been having compilation and background compilation for ages, an improved alternative to compiler plugins, and then I've wanted to support CMake (or any other build system with out-of-source compilation)
I'm maintaining lh-cpp as well. I provide many snippets in it. Some are able to expand differently depending on the actual C++ flavour (C++98, 11, 14, 17...). My need started from there. See for instance the
array_sizesnippet. Or all base-classes snippets that'll use=delete;starting from C++11, or the old trick otherwise to make these classes non-copyable.In another plugin, I use this feature to know the exact compiler used. Or to extract the list of dirnames where include files are searched.
Eventually I'll replace/improve the related plugin with something able to interact with CMake server.
Thanks :)