mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-05 15:04:37 +02:00
fix(edgy): only add symbolsoutline to the sidebar if it is installed.
This commit is contained in:
parent
09c1bf54ea
commit
ed89d01113
1 changed files with 98 additions and 91 deletions
|
@ -14,101 +14,108 @@ return {
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
{ "<leader>uE", function() require("edgy").select() end, desc = "Edgy Select Window" },
|
{ "<leader>uE", function() require("edgy").select() end, desc = "Edgy Select Window" },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = function()
|
||||||
bottom = {
|
local opts = {
|
||||||
{
|
bottom = {
|
||||||
ft = "toggleterm",
|
{
|
||||||
size = { height = 0.4 },
|
ft = "toggleterm",
|
||||||
filter = function(buf, win)
|
size = { height = 0.4 },
|
||||||
return vim.api.nvim_win_get_config(win).relative == ""
|
filter = function(buf, win)
|
||||||
|
return vim.api.nvim_win_get_config(win).relative == ""
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ft = "noice",
|
||||||
|
size = { height = 0.4 },
|
||||||
|
filter = function(buf, win)
|
||||||
|
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" },
|
||||||
|
{
|
||||||
|
ft = "help",
|
||||||
|
size = { height = 20 },
|
||||||
|
-- don't open help files in edgy that we're editing
|
||||||
|
filter = function(buf)
|
||||||
|
return vim.bo[buf].buftype == "help"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{ ft = "spectre_panel", size = { height = 0.4 } },
|
||||||
|
{ title = "Neotest Output", ft = "neotest-output-panel", size = { height = 15 } },
|
||||||
|
},
|
||||||
|
left = {
|
||||||
|
{
|
||||||
|
title = "Neo-Tree",
|
||||||
|
ft = "neo-tree",
|
||||||
|
filter = function(buf)
|
||||||
|
return vim.b[buf].neo_tree_source == "filesystem"
|
||||||
|
end,
|
||||||
|
pinned = true,
|
||||||
|
open = function()
|
||||||
|
vim.api.nvim_input("<esc><space>e")
|
||||||
|
end,
|
||||||
|
size = { height = 0.5 },
|
||||||
|
},
|
||||||
|
{ title = "Neotest Summary", ft = "neotest-summary" },
|
||||||
|
{
|
||||||
|
title = "Neo-Tree Git",
|
||||||
|
ft = "neo-tree",
|
||||||
|
filter = function(buf)
|
||||||
|
return vim.b[buf].neo_tree_source == "git_status"
|
||||||
|
end,
|
||||||
|
pinned = true,
|
||||||
|
open = "Neotree position=right git_status",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = "Neo-Tree Buffers",
|
||||||
|
ft = "neo-tree",
|
||||||
|
filter = function(buf)
|
||||||
|
return vim.b[buf].neo_tree_source == "buffers"
|
||||||
|
end,
|
||||||
|
pinned = true,
|
||||||
|
open = "Neotree position=top buffers",
|
||||||
|
},
|
||||||
|
"neo-tree",
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
-- increase width
|
||||||
|
["<c-Right>"] = function(win)
|
||||||
|
win:resize("width", 2)
|
||||||
|
end,
|
||||||
|
-- decrease width
|
||||||
|
["<c-Left>"] = function(win)
|
||||||
|
win:resize("width", -2)
|
||||||
|
end,
|
||||||
|
-- increase height
|
||||||
|
["<c-Up>"] = function(win)
|
||||||
|
win:resize("height", 2)
|
||||||
|
end,
|
||||||
|
-- decrease height
|
||||||
|
["<c-Down>"] = function(win)
|
||||||
|
win:resize("height", -2)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
}
|
||||||
ft = "noice",
|
local Util = require("lazyvim.util")
|
||||||
size = { height = 0.4 },
|
if Util.has("symbols-outline.nvim") then
|
||||||
filter = function(buf, win)
|
table.insert(opts.left, {
|
||||||
return vim.api.nvim_win_get_config(win).relative == ""
|
title = "Outline",
|
||||||
end,
|
ft = "outline",
|
||||||
},
|
|
||||||
{
|
|
||||||
ft = "lazyterm",
|
|
||||||
title = "LazyTerm",
|
|
||||||
size = { height = 0.4 },
|
|
||||||
filter = function(buf)
|
|
||||||
return not vim.b[buf].lazyterm_cmd
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
"Trouble",
|
|
||||||
{ ft = "qf", title = "QuickFix" },
|
|
||||||
{
|
|
||||||
ft = "help",
|
|
||||||
size = { height = 20 },
|
|
||||||
-- don't open help files in edgy that we're editing
|
|
||||||
filter = function(buf)
|
|
||||||
return vim.bo[buf].buftype == "help"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{ ft = "spectre_panel", size = { height = 0.4 } },
|
|
||||||
{ title = "Neotest Output", ft = "neotest-output-panel", size = { height = 15 } },
|
|
||||||
},
|
|
||||||
left = {
|
|
||||||
{
|
|
||||||
title = "Neo-Tree",
|
|
||||||
ft = "neo-tree",
|
|
||||||
filter = function(buf)
|
|
||||||
return vim.b[buf].neo_tree_source == "filesystem"
|
|
||||||
end,
|
|
||||||
pinned = true,
|
|
||||||
open = function()
|
|
||||||
vim.api.nvim_input("<esc><space>e")
|
|
||||||
end,
|
|
||||||
size = { height = 0.5 },
|
|
||||||
},
|
|
||||||
{ title = "Neotest Summary", ft = "neotest-summary" },
|
|
||||||
{
|
|
||||||
title = "Neo-Tree Git",
|
|
||||||
ft = "neo-tree",
|
|
||||||
filter = function(buf)
|
|
||||||
return vim.b[buf].neo_tree_source == "git_status"
|
|
||||||
end,
|
|
||||||
pinned = true,
|
|
||||||
open = "Neotree position=right git_status",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title = "Neo-Tree Buffers",
|
|
||||||
ft = "neo-tree",
|
|
||||||
filter = function(buf)
|
|
||||||
return vim.b[buf].neo_tree_source == "buffers"
|
|
||||||
end,
|
|
||||||
pinned = true,
|
|
||||||
open = "Neotree position=top buffers",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ft = "Outline",
|
|
||||||
pinned = true,
|
pinned = true,
|
||||||
open = "SymbolsOutline",
|
open = "SymbolsOutline",
|
||||||
},
|
})
|
||||||
"neo-tree",
|
end
|
||||||
},
|
return opts
|
||||||
keys = {
|
end,
|
||||||
-- increase width
|
|
||||||
["<c-Right>"] = function(win)
|
|
||||||
win:resize("width", 2)
|
|
||||||
end,
|
|
||||||
-- decrease width
|
|
||||||
["<c-Left>"] = function(win)
|
|
||||||
win:resize("width", -2)
|
|
||||||
end,
|
|
||||||
-- increase height
|
|
||||||
["<c-Up>"] = function(win)
|
|
||||||
win:resize("height", 2)
|
|
||||||
end,
|
|
||||||
-- decrease height
|
|
||||||
["<c-Down>"] = function(win)
|
|
||||||
win:resize("height", -2)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
-- prevent neo-tree from opening files in edgy windows
|
-- prevent neo-tree from opening files in edgy windows
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue