From f9b36bf730fda5488be87b91fd03a6f7cbf64e73 Mon Sep 17 00:00:00 2001 From: Daniil Rozanov Date: Wed, 24 Apr 2024 03:34:52 +0300 Subject: refactor: full rewrite --- lua/cmake/commands.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lua/cmake/commands.lua (limited to 'lua/cmake/commands.lua') diff --git a/lua/cmake/commands.lua b/lua/cmake/commands.lua new file mode 100644 index 0000000..78e5bb8 --- /dev/null +++ b/lua/cmake/commands.lua @@ -0,0 +1,31 @@ +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" }) +end + +return M -- cgit v1.2.3