As
CMake uses its own language, learning what commands are available can be a bit of a pain. I've written
this really basic Vim omni completion plugin that takes some of the effort out of getting to know the API. Install the file to the autoload directory in your .vim directory, i.e in ~/.vim/autoload/, and add the following line to your .vimrc file
autocmd FileType cmake set omnifunc=cmakecomplete#Complete
Now when you edit a CMakeLists.txt file, it should do omni completion when you summon help with the Ctrl-X Ctrl-O enchantment. Maybe someone will find it useful.

I've only tested this with the latest CMake and Vim versions, it is quite likely that I assume things that do not work in earlier editions of these programs. Patches welcome ;-)
Edit: Updated to add property and module completion
ths
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteu saved my life
ReplyDeleteGreat work! Thanks for the helpful script!
ReplyDeleteI didn't know about this feature. It even displays help about particular macros. Brilliant, thanks!
ReplyDelete