From 8de52fd4547f95bb4fc34c395b41437595b638fb Mon Sep 17 00:00:00 2001 From: Jedrzej Orbik Date: Mon, 2 Dec 2024 00:16:18 +0100 Subject: [PATCH] Update the 'Run script' overseer --- .../lua/overseer/template/user/run_script.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/stow/common/dot-config/nvim/lua/overseer/template/user/run_script.lua b/stow/common/dot-config/nvim/lua/overseer/template/user/run_script.lua index 36894f3..2995c00 100644 --- a/stow/common/dot-config/nvim/lua/overseer/template/user/run_script.lua +++ b/stow/common/dot-config/nvim/lua/overseer/template/user/run_script.lua @@ -2,9 +2,19 @@ return { name = "run script", builder = function() local file = vim.fn.expand("%:p") - local cmd = { file } - if vim.bo.filetype == "go" then - cmd = { "go", "run", file } + local filetype_cmds = { + go = { "go", "run" }, + python = { "python" }, + sh = { "bash" }, + } + + local filetype = vim.bo.filetype + local cmd = filetype_cmds[filetype] + + if cmd then + table.insert(cmd, file) + else + vim.notify("Oversser template - Unsupported filetype: " .. filetype) end return { cmd = cmd,