feat(nvim): add Overseer.nvim
Some checks failed
Check Formatting of Files / Check-Formatting (push) Has been cancelled
Some checks failed
Check Formatting of Files / Check-Formatting (push) Has been cancelled
This commit is contained in:
parent
d302b91b6f
commit
873b17f69e
@ -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,
|
||||
},
|
||||
|
@ -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,
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue
Block a user