From a5e8bbeb9d79d905a193e95a39acd29bc37e6c66 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Wed, 16 Sep 2026 08:47:13 +0200 Subject: Updated dotfiles --- neovim/.config/nvim/lua/plugins/overseer.lua | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 neovim/.config/nvim/lua/plugins/overseer.lua (limited to 'neovim/.config/nvim/lua/plugins/overseer.lua') diff --git a/neovim/.config/nvim/lua/plugins/overseer.lua b/neovim/.config/nvim/lua/plugins/overseer.lua new file mode 100644 index 0000000..99d0f5f --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/overseer.lua @@ -0,0 +1,57 @@ +-- 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" }, + }, + }, + }, +} -- cgit v1.3