aboutsummaryrefslogtreecommitdiff
path: root/lua/cmake/commands.lua
blob: c2f6e756cb6bfb258d24f57814825b54d2bd0fee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
local M = {}

local cmd = vim.api.nvim_create_user_command

M.register_commands = function()
	cmd("CMakeGenerate", function()
		require("cmake.actions").generate()
	end, { desc = "Generate with last configuration" })

	cmd("CMakeGenerateSelect", function()
		require("cmake.actions").generate_select()
	end, { desc = "Select configuration and generate" })

	cmd("CMakeBuild", function()
		require("cmake.actions").build()
	end, { desc = "Build with last build option" })

	cmd("CMakeBuildSelect", function()
		require("cmake.actions").build_select()
	end, { desc = "Select build option and build" })

	cmd("CMakeRun", function()
		require("cmake.actions").run_tagret()
	end, { desc = "Select build option and build" })

	cmd("CMakeRunSelect", function()
		require("cmake.actions").run_tagret_select()
	end, { desc = "Select build option and build" })

	cmd("CMakeToggle", function()
		require("cmake.actions").toggle()
	end, { desc = "Toggle terminal with cmake command" })

	cmd("CMakeEditVariants", function()
		require("cmake.actions").edit_variants()
	end, { desc = "Edit variants" })
end

return M