feat(nvim): add Overseer.nvim
Some checks failed
Check Formatting of Files / Check-Formatting (push) Has been cancelled

This commit is contained in:
Price Hiller 2024-06-23 05:52:46 -05:00
parent d302b91b6f
commit 873b17f69e
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB
2 changed files with 62 additions and 1 deletions

View File

@ -1108,7 +1108,7 @@ return {
disable_winbar_cb = function(args)
return conditions.buffer_matches({
buftype = { "nofile", "prompt", "quickfix", "terminal" },
filetype = { "fugitive", "Trouble", "dashboard", ".*neogit.*", "no-neck-pain" },
filetype = { "fugitive", "Trouble", "dashboard", ".*neogit.*", "Overseer.*" },
}, args.buf)
end,
},

View File

@ -0,0 +1,61 @@
return {
{
"stevearc/overseer.nvim",
cmd = {
"OverseerOpen",
"OverseerClose",
"OverseerToggle",
"OverseerSaveBundle",
"OverseerLoadBundle",
"OverseerDeleteBundle",
"OverseerRunCmd",
"OverseerRun",
"OverseerInfo",
"OverseerBuild",
"OverseerQuickAction",
"OverseerTaskAction",
"OverseerClearCache",
},
keys = {
{ "<leader>r", desc = "Overseer" },
{ "<leader>rr", "<cmd>OverseerRun<CR>", desc = "Overseer: Run" },
{ "<leader>rt", "<cmd>OverseerToggle<CR>", desc = "Overseer: Toggle" },
},
config = function()
local overseer = require("overseer")
overseer.setup()
local tempname_caches = {}
--- Get a temp file bound to the bufnr
local function tempname()
local bufnr = vim.api.nvim_get_current_buf()
if not tempname_caches[bufnr] then
tempname_caches[bufnr] = vim.fn.tempname()
end
return tempname_caches[bufnr]
end
overseer.register_template(
---@type overseer.TemplateDefinition
{
name = "Watch Typst",
desc = "Run `typst watch` and view the PDF",
---@return overseer.TaskDefinition
builder = function(_)
return {
cmd = {
"typst",
"watch",
"--open=xdg-open",
vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()),
tempname() .. ".pdf",
},
}
end,
condition = {
filetype = "typst",
},
}
)
end,
},
}