From a666316194529b1aa9d0eb3ed0df8c67fef384ec Mon Sep 17 00:00:00 2001 From: DarthMooMancer <107283522+DarthMooMancer@users.noreply.github.com> Date: Fri, 21 Mar 2025 08:17:08 -0400 Subject: [PATCH] Added Keybind for custom_run --- lua/Polydev/python.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/Polydev/python.lua b/lua/Polydev/python.lua index 264c9c0..c6ecd52 100644 --- a/lua/Polydev/python.lua +++ b/lua/Polydev/python.lua @@ -3,6 +3,7 @@ M.close_key = nil M.c_run = nil M.new_python_file = nil M.new_pip_module = nil +M.run_custom = nil M.config = { project_root = "~/Projects/Python", @@ -10,7 +11,8 @@ M.config = { [""] = "CloseTerminal", ["pr"] = "PythonRun", ["nf"] = "NewPythonFile", - ["pb"] = "PythonPip" + ["pb"] = "PythonPip", + ["pc"] = "PythonCustom" }, terminal = { right_padding = 0, @@ -31,6 +33,7 @@ function M.setup(opts) if command == "PythonRun" then M.c_run = key end if command == "NewPythonFile" then M.new_python_file = key end if command == "PythonPip" then M.new_pip_module = key end + if command == "PythonCustom" then M.run_custom = key end end local root = M.get_project_root() @@ -45,10 +48,13 @@ function M.setup(opts) vim.api.nvim_create_user_command("PythonPip", M.install_dependency, {}) vim.api.nvim_create_user_command("NewPythonFile", M.create_new_file, {}) vim.api.nvim_create_user_command("PythonRun", M.run, {}) + vim.api.nvim_create_user_command("PythonCustom", M.custom_run, {}) + vim.keymap.set("n", M.c_run, ":PythonRun", { silent = true }) vim.keymap.set("n", M.new_python_file, ":NewPythonFile", { silent = true }) vim.keymap.set("n", M.new_pip_module, ":PythonPip", { silent = true }) + vim.keymap.set("n", M.run_custom, ":PythonCustom", { silent = true }) end function M.open_float_terminal(cmd)