feat(snacks): use terminal

This commit is contained in:
Folke Lemaitre 2024-11-03 23:03:19 +01:00
parent 45acfaacb5
commit ad9d3d19b1
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
9 changed files with 77 additions and 89 deletions

View file

@ -31,14 +31,6 @@ return {
return vim.api.nvim_win_get_config(win).relative == ""
end,
},
{
ft = "lazyterm",
title = "LazyTerm",
size = { height = 0.4 },
filter = function(buf)
return not vim.b[buf].lazyterm_cmd
end,
},
"Trouble",
{ ft = "qf", title = "QuickFix" },
{
@ -103,6 +95,7 @@ return {
end
end
-- trouble
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do
opts[pos] = opts[pos] or {}
table.insert(opts[pos], {
@ -116,6 +109,22 @@ return {
end,
})
end
-- snacks float
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do
opts[pos] = opts[pos] or {}
table.insert(opts[pos], {
ft = "snacks_terminal",
size = { height = 0.4 },
title = "%{b:snacks_terminal.id}: %{b:term_title}",
filter = function(_buf, win)
return vim.w[win].snacks_float
and vim.w[win].snacks_float.position == pos
and vim.w[win].snacks_float.relative == "editor"
and not vim.w[win].trouble_preview
end,
})
end
return opts
end,
},