Skip to content

JanValiska/vim-cmake-menu

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

vim-cmake-menu

Show menu(using fzf) withc can be used to configure project(default/debug/release) and select active compilation target. After configuring/selecting target makeprg variable is set with appropriate build command.

Build can be started from cmake menu or by calling command :CMakeMenuBuild. If AsyncRun plugin is installed, build will be started asynchronously. Otherwise plain :make will be invoked.

If project is not configured, it can be configured from cmake menu.

Selecting of target is possible only after project configuration(default/debug/release) is done.

Installation

If you don't have a preferred installation method, I recommend installing plug.vim.

And then install plugin by placing:

Plug 'JanValiska/vim-cmake-menu'

Usage

Set current directory which contains root CMakeLists.txt and run :CMakeMenu.

All commands in cmake menu is also available as standalone commands:

  • :CMakeMenuBuild
  • :CMakeMenuConfigure
  • :CMakeMenuConfigureDebug
  • :CMakeMenuConfigureRelease
  • :CMakeMenuSelectTarget

Usefull keybinding

I used this keymaps:

autocmd FileType c,cpp,objc noremap <F10> :CMakeMenu<CR> autocmd FileType c,cpp,objc noremap <F9> :CMakeMenuBuild<CR>

Todo

  • add persistent configuration of configured projects
  • autodetect CMakeLists.txt on directory change
  • propt user to configure unconfigured project
  • add support to multiple "opened" projects
  • add support for cmake -E server(list of targets)
  • add support to run debugger from menu on selected target

License

As Vim itself. See :help license.

About

Create out of source build dir, call cmake and set makeprg variable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 100.0%