diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index 6bb84c78..262d5500 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -14,101 +14,108 @@ return { -- stylua: ignore { "uE", function() require("edgy").select() end, desc = "Edgy Select Window" }, }, - opts = { - bottom = { - { - ft = "toggleterm", - size = { height = 0.4 }, - filter = function(buf, win) - return vim.api.nvim_win_get_config(win).relative == "" + opts = function() + local opts = { + bottom = { + { + ft = "toggleterm", + size = { height = 0.4 }, + 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("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 + [""] = function(win) + win:resize("width", 2) + end, + -- decrease width + [""] = function(win) + win:resize("width", -2) + end, + -- increase height + [""] = function(win) + win:resize("height", 2) + end, + -- decrease height + [""] = function(win) + win:resize("height", -2) 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("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", + } + local Util = require("lazyvim.util") + if Util.has("symbols-outline.nvim") then + table.insert(opts.left, { + title = "Outline", + ft = "outline", pinned = true, open = "SymbolsOutline", - }, - "neo-tree", - }, - keys = { - -- increase width - [""] = function(win) - win:resize("width", 2) - end, - -- decrease width - [""] = function(win) - win:resize("width", -2) - end, - -- increase height - [""] = function(win) - win:resize("height", 2) - end, - -- decrease height - [""] = function(win) - win:resize("height", -2) - end, - }, - }, + }) + end + return opts + end, }, -- prevent neo-tree from opening files in edgy windows