-- Run configurations (PyCharm-style "run this again"), language-agnostic: -- works for npm scripts, make, cargo, arbitrary shell commands, python -- scripts, etc, unlike DAP which is Python-only for now. return { "stevearc/overseer.nvim", -- Not left to lazy-load off `cmd`/`keys`: a project's .nvim.lua (see -- lua/config/project_run.lua) needs `require("overseer")` to work -- immediately when exrc sources it, which requires the plugin already -- being on runtimepath rather than deferred until first use. lazy = false, keys = { { "rr", "OverseerRun", desc = "Run task" }, { "rl", function() -- :OverseerRestartLast exists in current overseer.nvim versions; the -- run_action fallback covers older/newer versions that lack it -- rather than hard-failing the keymap. if vim.fn.exists(":OverseerRestartLast") == 2 then vim.cmd("OverseerRestartLast") return end local overseer = require("overseer") local tasks = overseer.list_tasks({ recent_first = true }) if vim.tbl_isempty(tasks) then vim.notify("No previous task to rerun", vim.log.levels.WARN) else overseer.run_action(tasks[1], "restart") end end, desc = "Rerun last task", }, { "ro", "OverseerToggle", desc = "Toggle task list/output" }, { "rq", "OverseerQuickAction", desc = "Quick action on task" }, }, opts = { -- Patches nvim-dap so a debug config can set preLaunchTask/postDebugTask -- to an overseer task name (or "${defaultBuildTask}" for whatever task -- is tagged BUILD) - lets a dap.configurations entry build before it -- launches the debugger. See README's Debugging section. dap = true, -- overseer's actual default components (on_exit_set_status, -- on_complete_notify, on_complete_dispose) don't open the output panel -- on their own - without open_output added here, starting any task -- (whether from a template, .nvim.lua/project_run.lua, or auto-detected -- npm/make scripts) runs silently until you manually ro to look. -- Adding it here applies to every task, not just custom ones. component_aliases = { default = { "on_exit_set_status", "on_complete_notify", { "on_complete_dispose", require_view = { "SUCCESS", "FAILURE" } }, { "open_output", direction = "dock", focus = false, on_start = "always" }, }, }, }, }