From 8be5da1fbc5ee0ac88b1934c075b7bc2bd5e26c5 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 6 Jun 2023 15:34:30 +0100 Subject: [PATCH] Add edgy with recommended config, adjust some plugins to work with it Neotree is back on the side for edgy support ToggleTerm back to horizontal rather than tab --- lua/plugins/alpha.lua | 12 ++----- lua/plugins/edgy.lua | 55 +++++++++++++++++++++++++++++++++ lua/plugins/neotree.lua | 2 +- lua/plugins/symbols-outline.lua | 7 +++++ lua/plugins/toggleterm.lua | 9 ++---- 5 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 lua/plugins/edgy.lua create mode 100644 lua/plugins/symbols-outline.lua diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua index e1cbee1..8d24eda 100644 --- a/lua/plugins/alpha.lua +++ b/lua/plugins/alpha.lua @@ -14,19 +14,11 @@ return { ]] dashboard.section.header.val = vim.split(logo, "\n") - -- dashboard.section.header.val = { - -- [[ __ ]], - -- [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], - -- [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]], - -- [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]], - -- [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]], - -- [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], - -- } dashboard.section.buttons.val = { - dashboard.button("t", " " .. " Terminal", "ToggleTerm direction=tab "), + dashboard.button("t", " " .. " Terminal", "ToggleTerm "), dashboard.button("f", " " .. " Find file", "Telescope find_files "), dashboard.button("r", " " .. " Recent files", "Telescope oldfiles "), - dashboard.button("n", " " .. " Neo-tree", "Neotree float "), + dashboard.button("n", " " .. " Neo-tree", "Neotree "), dashboard.button("g", "󰊢 " .. " Git status", "Neogit "), dashboard.button("c", " " .. " Config", "e $MYVIMRC "), dashboard.button("l", "󰒲 " .. " Lazy", "Lazy"), diff --git a/lua/plugins/edgy.lua b/lua/plugins/edgy.lua new file mode 100644 index 0000000..31b2d7d --- /dev/null +++ b/lua/plugins/edgy.lua @@ -0,0 +1,55 @@ +return { + "folke/edgy.nvim", + event = "VeryLazy", + opts = { + bottom = { + -- toggleterm / lazyterm at the bottom with a height of 40% of the screen + { ft = "toggleterm", size = { height = 0.4 } }, + { + 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 }, + -- only show help buffers + filter = function(buf) return vim.bo[buf].buftype == "help" end, + }, + { ft = "spectre_panel", size = { height = 0.4 } }, + }, + left = { + -- Neo-tree filesystem always takes half the screen height + { + title = "Neo-Tree", + ft = "neo-tree", + filter = function(buf) return vim.b[buf].neo_tree_source == "filesystem" end, + size = { height = 0.5 }, + }, + { + 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, + open = "SymbolsOutline", + }, + -- any other neo-tree windows + "neo-tree", + }, + }, +} diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua index 7dee9b4..791f166 100644 --- a/lua/plugins/neotree.lua +++ b/lua/plugins/neotree.lua @@ -10,7 +10,7 @@ return { cmd = "Neotree", init = function() vim.g.neo_tree_remove_legacy_commands = 1 - vim.keymap.set("n", "nn", "Neotree float reveal reveal_force_cwd") + vim.keymap.set("n", "nn", "Neotree reveal reveal_force_cwd") end, config = true, opts = { diff --git a/lua/plugins/symbols-outline.lua b/lua/plugins/symbols-outline.lua new file mode 100644 index 0000000..6fbb7d0 --- /dev/null +++ b/lua/plugins/symbols-outline.lua @@ -0,0 +1,7 @@ +return { + "simrat39/symbols-outline.nvim", + cond = not vim.g.vscode, + cmd = "SymbolsOutline", + dependencies = { "neovim/nvim-lspconfig" }, + config = true, +} diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua index 9039572..1493d22 100644 --- a/lua/plugins/toggleterm.lua +++ b/lua/plugins/toggleterm.lua @@ -3,11 +3,6 @@ return { cond = not vim.g.vscode, version = "*", cmd = { "ToggleTerm" }, - init = function() - vim.keymap.set("n", "tt", "ToggleTerm direction=tab") - vim.keymap.set("n", "th", "ToggleTerm direction=horizontal") - vim.keymap.set("n", "tv", "ToggleTerm direction=vertical") - vim.keymap.set("n", "tf", "ToggleTerm direction=float") - end, - config = true, + init = function() vim.keymap.set("n", "tt", "ToggleTerm") end, + opts = { direction = "horizontal" }, }