• Stars
    star
    354
  • Rank 120,042 (Top 3 %)
  • Language
    Lua
  • License
    GNU General Publi...
  • Created over 2 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CMake integration in Neovim

CMake Tools

🔥CMake Tools for Neovim which is written in pure lua.🔥

CREDIT:

It is a fork from the brilliant neovim-cmake. Since I change too much of it, So I make a new repo to develop it.

The goal of this plugin is to offer a comprehensive, convenient, and powerful workflow for CMake-based projects in Neovim, comparable to the functionality provided by vscode-cmake-tools for Visual Studio Code.

Installation

  • Require Neovim (>=0.7).
  • Require plenary.
  • Install it like any other Neovim plugin.

🎈 Configuration

require("cmake-tools").setup {
  cmake_command = "cmake", -- this is used to specify cmake command path
  cmake_regenerate_on_save = true, -- auto generate when save CMakeLists.txt
  cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" }, -- this will be passed when invoke `CMakeGenerate`
  cmake_build_options = {}, -- this will be passed when invoke `CMakeBuild`
  cmake_build_directory = "", -- this is used to specify generate directory for cmake
  cmake_build_directory_prefix = "cmake_build_", -- when cmake_build_directory is set to "", this option will be activated
  cmake_soft_link_compile_commands = true, -- this will automatically make a soft link from compile commands file to project root dir
  cmake_compile_commands_from_lsp = false, -- this will automatically set compile commands file location using lsp, to use it, please set `cmake_soft_link_compile_commands` to false
  cmake_kits_path = nil, -- this is used to specify global cmake kits path, see CMakeKits for detailed usage
  cmake_variants_message = {
    short = { show = true }, -- whether to show short message
    long = { show = true, max_length = 40 } -- whether to show long message
  },
  cmake_dap_configuration = { -- debug settings for cmake
    name = "cpp",
    type = "codelldb",
    request = "launch",
    stopOnEntry = false,
    runInTerminal = true,
    console = "integratedTerminal",
  },
  cmake_always_use_terminal = false, -- if true, use terminal for generate, build, clean, install, run, etc, except for debug, else only use terminal for run, use quickfix for others
  cmake_quickfix_opts = { -- quickfix settings for cmake, quickfix will be used when `cmake_always_use_terminal` is false
    show = "always", -- "always", "only_on_error"
    position = "belowright", -- "bottom", "top"
    size = 10,
  },
  cmake_terminal_opts = { -- terminal settings for cmake, terminal will be used for run when `cmake_always_use_terminal` is false or true, will be used for all tasks except for debug when `cmake_always_use_terminal` is true
    name = "Main Terminal",
    prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name
    split_direction = "horizontal", -- "horizontal", "vertical"
    split_size = 11,

    -- Window handling
    single_terminal_per_instance = true, -- Single viewport, multiple windows
    single_terminal_per_tab = true, -- Single viewport per tab
    keep_terminal_static_location = true, -- Static location of the viewport if avialable

    -- Running Tasks
    start_insert_in_launch_task = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun
    start_insert_in_other_tasks = false, -- If you want to enter terminal with :startinsert upon launching all other cmake tasks in the terminal. Generally set as false
    focus_on_main_terminal = false, -- Focus on cmake terminal when cmake task is launched. Only used if cmake_always_use_terminal is true.
    focus_on_launch_terminal = false, -- Focus on cmake launch terminal when executable target in launched.
  }
}

Generally, the default is enough.

🪄 Docs

  1. basic usage
  2. all commands
  3. cmake presets
  4. cmake kits
  5. cmake variants
  6. sessions
  7. how to

💪 Contribute

If you want to implement a missing feature, consider making a PR.

LICENCE

GPL-3.0 License © Civitasv

Reference

  1. vscode-cmake-tools is an amazing plugin for CMake-based project in Visual Studio Code, MIT LICENSE.
  2. Inspired by neovim-cmake which is made by Shatur, GPL-3.0 license.
  3. plenary, MIT LICENSE.

More Repositories

1

AMapPoi

POI搜索工具、地理编码工具
Java
451
star
2

runvim

Beautiful, fast, functional Configuration for Neovim.
Lua
97
star
3

DataV_GeoJSON

中国行政区边界,包括国家级/省级/市级/区县级,GCJ02坐标
Python
72
star
4

vue-blog

个人博客 Vue+SpringBoot+MySQL 前后端分离
Vue
29
star
5

asciichart

Nice-looking lightweight console ASCII line charts, using C++, no dependencies.
C++
28
star
6

mini-json-parser

A Tiny Json Parser
C++
22
star
7

scxx

Scheme interpreter in C++, with the power of modern C++ and RAII.
C++
10
star
8

cpp

cpp interview
C++
8
star
9

supermap

SuperMap
JavaScript
8
star
10

android-ios-like-dialog

仿IOS制作的一套Android弹窗组件
Java
8
star
11

learning-cplusplus

learning world's best designed (okay, at least best hated) language.
C
6
star
12

piorun

C++
5
star
13

FE_interview_2020

2020前端面试总结
4
star
14

heart_beat

Heart Beat
C
4
star
15

Android-Paging

Use Paging In MVVM Architecture
Java
4
star
16

TWE

To what end, to what end
Emacs Lisp
3
star
17

CartoVision

慧图官网开发
JavaScript
3
star
18

c-programming-a-modern-approach

C语言程序设计:现代方法 笔记及题目解答
C
3
star
19

leetcode-cpp

Leetcode repo
C++
3
star
20

linmujun

HTML
3
star
21

PoiKit

PoiKit - which is implemented by python
Python
3
star
22

COVID

新冠疫情数据可视化
Vue
2
star
23

tutorial

C
2
star
24

pair-colorizer

Emacs pair colorizer
Emacs Lisp
2
star
25

thinking-in-java

Java编程思想读书笔记
1
star
26

BookSystem

Jsp项目--图书管理系统
Java
1
star
27

cpp2microservice

From c/cpp algorithms to micro services, from micro services to k8s
Python
1
star
28

please

Todo list in terminal.
C++
1
star
29

idea_settings

1
star
30

JAVA_TECH

Java
1
star
31

NewsMap

JavaScript
1
star
32

machine-learning

Machine Learning(by Stanford University) Repo
MATLAB
1
star
33

visual.gl

地理数据可视化(持续更新...)
Vue
1
star
34

godot-projects

GDScript
1
star
35

tcp_sevr

Simple http server in C++, using socket and epoll.
C++
1
star
36

raylib_sandbox

Sandbox for raylib
C
1
star
37

mdp.nvim

Preview markdown utlizing pandoc.
Lua
1
star
38

cake

Trying to make C/C++ Development Easier.
C++
1
star
39

WeOpenAI

A really thin wrapper for OpenAI, to be continued...
Vue
1
star
40

cengine

My attempts on Game Engine.
C++
1
star