2024-09-23 23:22:44 +02:00
|
|
|
if vim.g.did_load_overseer_plugin then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
vim.g.did_load_overseer_plugin = true
|
|
|
|
|
2024-10-01 13:40:05 +02:00
|
|
|
local file_exists = require("user.file_exists").file_exists
|
|
|
|
|
2024-09-23 23:22:44 +02:00
|
|
|
require("which-key").add({
|
|
|
|
{ "<leader>o", group = "[o]verseer", icon = "" },
|
|
|
|
{ "<leader>ot", "<Cmd>OverseerToggle<CR>", desc = "[o]verseer: [t]oggle " },
|
|
|
|
{ "<leader>oc", "<Cmd>OverseerRunCmd<CR>", desc = "[o]verseer: run [c]ommand" },
|
|
|
|
{ "<leader>or", "<Cmd>OverseerRun<CR>", desc = "[o]verseer: [r]un task" },
|
|
|
|
{ "<leader>oq", "<Cmd>OverseerQuickAction<CR>", desc = "[o]verseer: [q]uick action" },
|
|
|
|
{ "<leader>oa", "<Cmd>OverseerTaskAction<CR>", desc = "[o]verseer: task [a]ction" },
|
|
|
|
{ "<leader>oi", "<Cmd>OverseerInfo<CR>", desc = "[o]verseer: [i]nfo" },
|
|
|
|
})
|
|
|
|
|
|
|
|
local root_files = {
|
|
|
|
'.vscode',
|
|
|
|
'.git',
|
|
|
|
}
|
|
|
|
|
2024-10-01 13:40:05 +02:00
|
|
|
local root = vim.fs.find(root_files, { upward = true })[1]
|
|
|
|
|
|
|
|
if root then
|
|
|
|
if file_exists(root .. ".vscode/tasks.json") then
|
|
|
|
require('overseer').setup({
|
|
|
|
strategy = {
|
|
|
|
"toggleterm",
|
|
|
|
quit_on_exit = "success",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|
2024-09-23 23:22:44 +02:00
|
|
|
end
|