From aeeb3f0ea424e3a4e47322b0966d121001434ff3 Mon Sep 17 00:00:00 2001 From: Andreas Olsson Date: Mon, 17 Feb 2025 16:19:51 +0100 Subject: [PATCH 1/2] Rename --- lua/{cmder => tmuxcmd}/init.lua | 11 +++++++---- lua/{cmder => tmuxcmd}/window.lua | 0 2 files changed, 7 insertions(+), 4 deletions(-) rename lua/{cmder => tmuxcmd}/init.lua (66%) rename lua/{cmder => tmuxcmd}/window.lua (100%) diff --git a/lua/cmder/init.lua b/lua/tmuxcmd/init.lua similarity index 66% rename from lua/cmder/init.lua rename to lua/tmuxcmd/init.lua index cbd85f3..df6c6ce 100644 --- a/lua/cmder/init.lua +++ b/lua/tmuxcmd/init.lua @@ -1,4 +1,4 @@ -local Window = require("cmder.window") +local Window = require("tmuxcmd.window") local M = {} @@ -22,16 +22,19 @@ function M.openMainMenu() Window.createTelescopeWindow(options, select_current_line, nil, "Available Commands") end +local function executeCommand(command) + vim.fn.system('tmux send-keys -t scratch "' .. command .. '" ^M') +end function M.executeCommand(command) if command == "Build and Test" then - vim.fn.system("tmux send-keys -t scratch \"dotnet build --interactive && dotnet test\" ^M") + executeCommand("dotnet build --interactive && dotnet test") elseif command == "Build with only errors" then - vim.fn.system("tmux send-keys -t scratch \"dotnet build /property:WarningLevel=0\" ^M") + executeCommand("dotnet build /property:WarningLevel=0") end vim.fn.system("tmux select-window -t scratch") end -vim.api.nvim_create_user_command("Cmder", function() +vim.api.nvim_create_user_command("Tmuxcmd", function() M.openMainMenu() end, { nargs = "*", desc = "Cmder plugin" }) diff --git a/lua/cmder/window.lua b/lua/tmuxcmd/window.lua similarity index 100% rename from lua/cmder/window.lua rename to lua/tmuxcmd/window.lua From ff7795d1d5d63ad30aceaac80fafb33d0a38618e Mon Sep 17 00:00:00 2001 From: Andreas Olsson Date: Mon, 17 Feb 2025 16:20:28 +0100 Subject: [PATCH 2/2] lint and stylua --- lua/tmuxcmd/init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/tmuxcmd/init.lua b/lua/tmuxcmd/init.lua index df6c6ce..f01f083 100644 --- a/lua/tmuxcmd/init.lua +++ b/lua/tmuxcmd/init.lua @@ -2,8 +2,7 @@ local Window = require("tmuxcmd.window") local M = {} -function M.setup() -end +function M.setup() end function M.openMainMenu() local options = {