mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-17 17:23:24 +02:00
feat(snacks): use terminal
This commit is contained in:
parent
45acfaacb5
commit
ad9d3d19b1
9 changed files with 77 additions and 89 deletions
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue