2024-05-31 15:33:17 +00:00
|
|
|
return {
|
|
|
|
-- Simple task runner plugin
|
|
|
|
'stevearc/overseer.nvim',
|
|
|
|
opts = {},
|
2024-06-05 11:07:31 +00:00
|
|
|
config = function()
|
2024-06-04 12:23:25 +00:00
|
|
|
local overseer = require 'overseer'
|
2024-06-05 11:07:31 +00:00
|
|
|
overseer.setup {
|
|
|
|
templates = {
|
|
|
|
'builtin',
|
|
|
|
'golang.run_project',
|
|
|
|
'golang.run_file',
|
|
|
|
},
|
|
|
|
}
|
2024-05-31 15:33:17 +00:00
|
|
|
|
2024-07-23 20:08:55 +00:00
|
|
|
-- Reference: overseer.nvim/lua/overseer/window.lua
|
|
|
|
local function is_open()
|
|
|
|
for _, winid in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
|
|
|
|
local bufnr = vim.api.nvim_win_get_buf(winid)
|
|
|
|
if vim.bo[bufnr].filetype == 'OverseerList' then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
2024-05-31 15:33:17 +00:00
|
|
|
-- Display status info about tasks
|
2024-06-04 12:23:25 +00:00
|
|
|
vim.keymap.set('n', '<leader>ol', function()
|
|
|
|
overseer.toggle { winid = 0 }
|
2024-07-23 20:08:55 +00:00
|
|
|
if is_open() then
|
|
|
|
vim.cmd.winc '_'
|
|
|
|
else
|
|
|
|
vim.api.nvim_buf_delete(vim.api.nvim_get_current_buf(), {})
|
|
|
|
end
|
2024-06-04 12:23:25 +00:00
|
|
|
end, { desc = '[O]verseer [L]og' })
|
2024-05-31 15:33:17 +00:00
|
|
|
-- Run task by listing all in floating
|
|
|
|
vim.keymap.set('n', '<leader>or', '<cmd>OverseerRun<cr>', { desc = '[O]verseer [R]un' })
|
|
|
|
end,
|
|
|
|
}
|