Git Product home page Git Product logo

edgy.nvim's Introduction

🪟 edgy.nvim

A Neovim plugin to easily create and manage predefined window layouts, bringing a new edge to your workflow.

image

✨ Features

  • 🔄 Automatically move windows (including floating windows) in a pre-defined layout
  • 📐 Manage layouts while keeping your main editor splits untouched.
  • 🔧 Personalize edgebar window options to fit your style.
  • 📌 Pinned views are always shown in the edgebar even when they have no windows.
  • ⌨️ Make navigation easier with personalized buffer-local keymaps for edgebar windows.
  • 🎆 Pretty animations (works well with mini.animate)
  • 🧩 Works with any plugin. Check Show and Tell for snippets to integrate even better with plugins like neo-tree.nvim, bufferline.nvim

⚠️ Limitations

  • fully collapsing windows only works with the global statusline.
  • edgebar windows can not be resized like normal windows. It's tricky to detect if a window was resized by the user or by a plugin. Check the config section about keys. Regular window keymaps have been added for resizing windows.
  • requires Neovim >= 0.9.2 or Neovim >= 0.10.0 (after June 5, 2023) for proper folding. If you're on an older nightly, you can set fix_win_height to true to make it work.
  • some flickering may occur when windows are being moved in their correct position. Should be minimal, but may be more visible for some plugins that don't set the buffer filetype during the frame where the window was created.

📦 Installation

Install the plugin with your preferred package manager:

lazy.nvim:

{
  "folke/edgy.nvim",
  event = "VeryLazy",
  opts = {}
}

If you're not using lazy.nvim, make sure to call require("edgy").setup(opts?).

Recommended Neovim options:

-- views can only be fully collapsed with the global statusline
vim.opt.laststatus = 3
-- Default splitting will cause your main splits to jump when opening an edgebar.
-- To prevent this, set `splitkeep` to either `screen` or `topline`.
vim.opt.splitkeep = "screen"

⚙️ Configuration

edgy.nvim comes with the following defaults:

{
  left = {}, ---@type (Edgy.View.Opts|string)[]
  bottom = {}, ---@type (Edgy.View.Opts|string)[]
  right = {}, ---@type (Edgy.View.Opts|string)[]
  top = {}, ---@type (Edgy.View.Opts|string)[]

  ---@type table<Edgy.Pos, {size:integer | fun():integer, wo?:vim.wo}>
  options = {
    left = { size = 30 },
    bottom = { size = 10 },
    right = { size = 30 },
    top = { size = 10 },
  },
  -- edgebar animations
  animate = {
    enabled = true,
    fps = 100, -- frames per second
    cps = 120, -- cells per second
    on_begin = function()
      vim.g.minianimate_disable = true
    end,
    on_end = function()
      vim.g.minianimate_disable = false
    end,
    -- Spinner for pinned views that are loading.
    -- if you have noice.nvim installed, you can use any spinner from it, like:
    -- spinner = require("noice.util.spinners").spinners.circleFull,
    spinner = {
      frames = { "", "", "", "", "", "", "", "", "", "" },
      interval = 80,
    },
  },
  -- enable this to exit Neovim when only edgy windows are left
  exit_when_last = false,
  -- close edgy when all windows are hidden instead of opening one of them
  -- disable to always keep at least one edgy split visible in each open section
  close_when_all_hidden = true,
  -- global window options for edgebar windows
  ---@type vim.wo
  wo = {
    -- Setting to `true`, will add an edgy winbar.
    -- Setting to `false`, won't set any winbar.
    -- Setting to a string, will set the winbar to that string.
    winbar = true,
    winfixwidth = true,
    winfixheight = false,
    winhighlight = "WinBar:EdgyWinBar,Normal:EdgyNormal",
    spell = false,
    signcolumn = "no",
  },
  -- buffer-local keymaps to be added to edgebar buffers.
  -- Existing buffer-local keymaps will never be overridden.
  -- Set to false to disable a builtin.
  ---@type table<string, fun(win:Edgy.Window)|false>
  keys = {
    -- close window
    ["q"] = function(win)
      win:close()
    end,
    -- hide window
    ["<c-q>"] = function(win)
      win:hide()
    end,
    -- close sidebar
    ["Q"] = function(win)
      win.view.edgebar:close()
    end,
    -- next open window
    ["]w"] = function(win)
      win:next({ visible = true, focus = true })
    end,
    -- previous open window
    ["[w"] = function(win)
      win:prev({ visible = true, focus = true })
    end,
    -- next loaded window
    ["]W"] = function(win)
      win:next({ pinned = false, focus = true })
    end,
    -- prev loaded window
    ["[W"] = function(win)
      win:prev({ pinned = false, focus = true })
    end,
    -- increase width
    ["<c-w>>"] = function(win)
      win:resize("width", 2)
    end,
    -- decrease width
    ["<c-w><lt>"] = function(win)
      win:resize("width", -2)
    end,
    -- increase height
    ["<c-w>+"] = function(win)
      win:resize("height", 2)
    end,
    -- decrease height
    ["<c-w>-"] = function(win)
      win:resize("height", -2)
    end,
    -- reset all custom sizing
    ["<c-w>="] = function(win)
      win.view.edgebar:equalize()
    end,
  },
  icons = {
    closed = "",
    open = "",
  },
  -- enable this on Neovim <= 0.10.0 to properly fold edgebar windows.
  -- Not needed on a nightly build >= June 5, 2023.
  fix_win_height = vim.fn.has("nvim-0.10.0") == 0,
}

👁️ Edgy.View.Opts

Property Type Description
ft string File type of the view
filter fun(buf:buffer, win:window)? Optional function to filter buffers and windows
title string? Optional title of the view. Defaults to the capitalized filetype
size number or fun():number Size of the short edge of the edgebar. For edgebars, this is the minimum width. For panels, minimum height.
pinned boolean? If true, the view will always be shown in the edgebar even when it has no windows
open fun() or string Function or command to open a pinned view
wo vim.wo? View-specific window options

🚀 Usage

Just open windows/buffers as you normally do, but now they will be displayed in your layout.

⌨️ Keymaps for Edgebar Windows

Keymap Description
q Close the window
<c-q> Hide the window
Q Close the edgebar
]w, [w Next/Prev open window
]W, [W Next/Prev loaded window

🔌 API

  • require("edgy").select(pos?, filter?) select a window with vim.ui.select in the given position or in all edgebars using an optional filter
  • require("edgy").close(pos?) close all edgebars or a edgebar in the given position
  • require("edgy").open(pos?) open all pinned views in the given position
  • require("edgy").toggle(pos?) toggle all pinned views in the given position
  • require("edgy").goto_main() move the cursor to the last focused main window
  • require("edgy").get_win(window?) get the Edgy.Window object for the given window or the current window

🪟 Example Setup

{
  "folke/edgy.nvim",
  event = "VeryLazy",
  init = function()
    vim.opt.laststatus = 3
    vim.opt.splitkeep = "screen"
  end,
  opts = {
    bottom = {
      -- toggleterm / lazyterm at the bottom with a height of 40% of the screen
      {
        ft = "toggleterm",
        size = { height = 0.4 },
        -- exclude floating windows
        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 },
        -- 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 = "SymbolsOutlineOpen",
      },
      -- any other neo-tree windows
      "neo-tree",
    },
  },
}

🐯 Tips & tricks

  • disable edgy for a window/buffer by setting vim.b[buf].edgy_disable or vim.w[win].edgy_disable. You can even set this after the facts. Edgy will then expunge the window from the layout.

  • check the Show and Tell section of the github discussions for snippets for better integration with plugins like neo-tree.nvim, bufferline.nvim, ...

edgy.nvim's People

Contributors

danields761 avatar folke avatar github-actions[bot] avatar willothy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

edgy.nvim's Issues

bug: Strange issue with neotest quickfix

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev

Operating system/version

ubuntu 22.04

Describe the bug

I believe a bug I reported to neotest has something to do with edgy and how it spawns windows for its quickfix.

nvim-neotest/neotest#269

Linked to the bug. Not sure how to make a minimal reproduction, but trying now.

Steps To Reproduce

  1. Run neotest and have an error which shows the quickfix menu

Expected Behavior

No errors

Edit*
It would appear after more config changing and testing, the issue is related to the Trouble Quickfix menu, and the neotest E36 error in the bug report above.

https://github.com/Thevetat/nvim

bug: Edgy is loosing track of toggleterm windows

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.10

Operating system/version

Ubuntu 22

Describe the bug

When using many different toggleterms at the same time, edgy only allows you to resize the width on one of them. It seems that the other terms' windows are not managed by edgy

Steps To Reproduce

  1. Create one toggleterm and without hidding it
  2. Create a second toggle term
  3. Try To <C-Right/Left> on both to increase/decrease the width, and only one will work

Expected Behavior

Both terms's windows are managed the equally

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/edgy.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Suggested change in Example Setup

It's not a bug or issue with edgy.nvim but with Symbols Outline.
The toggle functionality on SymbolsOutline keeps crashing after first open with the following error:

Error executing lua callback: ...e/nvim/lazy/symbols-outline.nvim/lua/symbols-outline.lua:208: Cursor position outside buffer
stack traceback:
        [C]: in function 'nvim_win_set_cursor'
        ...e/nvim/lazy/symbols-outline.nvim/lua/symbols-outline.lua:208: in function '_highlight_current_item'
        ...e/nvim/lazy/symbols-outline.nvim/lua/symbols-outline.lua:19: in function <...e/nvim/lazy/symbols-outline.nvim/lua/symbols-outline.lua:18>

I changed it to simply use the 'Open' option and it works well:

{
        ft = "Outline",
        pinned = true,
        open = "SymbolsOutlineOpen",
},

Just something to consider.
Other than that, great plugin.. enjoying it quite a lot.

PS: I'm using Neovim >= 0.10.0 (after June 5, 2023)

bug: Buffers don't open with transparent background using transparent.nvim(when there is a filter rule?)

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.10.0-dev-422+g68e2d7229

Operating system/version

Linux6.3.5-arch1-1

Describe the bug

Whenever opening a buffer(e.g. neotree and spectre), the background does not turn transparent, but instead uses the theme's background.

Which goes transparent if I move away from the buffer and move back.

Notably, using the repro config, the filter has to be there for it to happen.

Steps To Reproduce

  1. Enable transparency with transparent.nvim
  2. Open neotree with :Neotree toggle
  3. Panel isn't transparent

Expected Behavior

The buffer opens with transparent background

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",

  "nvim-lua/plenary.nvim",
  "MunifTanjim/nui.nvim",
  "nvim-neo-tree/neo-tree.nvim",

  {
    "folke/edgy.nvim",
    opts = {
      left = {
        {
          -- title = "Neo-Tree",
          ft = "neo-tree",
          filter = function(buf)
            return vim.b[buf].neo_tree_source == "filesystem"
          end,
        }
      }
    }
  },
  {
    "xiyaowong/transparent.nvim",
    opts = {
      extra_groups = {
        "NeoTreeNormal",
        "NeoTreeNormalNC",
      }
    }
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-

bug: Failed to layout windows

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.10.0-dev-2619+gc52dfb6e8

Operating system/version

Windows 11

Describe the bug

When opening Neo-Tree (or NvimTree as well), switching to a new tab, opening another Neo-Tree window there, then switching back to the original tab, I get this error:

...AppData/Local/nvim-data/lazy/edgy.nvim/lua/edgy/util.lua:70: ...Data/Local/nvim-data/lazy/edgy.nvim/lua/edgy/edgebar.lua:207: Edgy: Failed to layout windows.
Vim:E957: Invalid window number
{
  last = "neo-tree",
  win = "edgy"
}

The error repeats with identical notifications forever and I have to quit out of Neovim. I just tried this with a basic setup of only Lazy, Neo-Tree, and Edgy with no additional configuration other than the config described on the Edgy git page, and I get the same behavior. I also checked the non-nightly build of Neovim and I'm getting the same thing. This only seems to happen when there are multiple Neo-Tree windows in the edgebar config, but I'm also getting the problem with Nvim-Tree and only a single Nvim-Tree window in the edgebar. I'm assuming this is a bug since I just copied the config from Github. Thank you and I'm otherwise loving this plugin!

Steps To Reproduce

  1. open Neo-Tree
  2. switch to a new tab
  3. open Neo-Tree there without closing Neo-Tree in the first tab
  4. switch back to the original tab

Expected Behavior

Neovim is not flooded with error notifications

Repro

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

-- Example using a list of specs with the default options
vim.g.mapleader = " " -- Make sure to set `mapleader` before lazy so your mappings are correct
vim.g.maplocalleader = "\\" -- Same for `maplocalleader`

require("lazy").setup({
{
    "nvim-neo-tree/neo-tree.nvim",
    branch = "v3.x",
    dependencies = {
      "nvim-lua/plenary.nvim",
      "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
      "MunifTanjim/nui.nvim",
      -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
    }
},
{
  "folke/edgy.nvim",
  event = "VeryLazy",
  init = function()
    vim.opt.laststatus = 3
    vim.opt.splitkeep = "screen"
  end,
  opts = {
    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",
      },
      -- any other neo-tree windows
      "neo-tree",
    },
  },
}
})

bug: Not an editor command: SymbolsOutline

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.1

Operating system/version

macOS 13.0.1

Describe the bug

Running a vanilla lazyvim installation, and enabled the following plugins

require("lazy").setup({
  spec = {
    -- add LazyVim and import its plugins
    { "LazyVim/LazyVim", import = "lazyvim.plugins" },
    -- UI
    { import = "lazyvim.plugins.extras.ui.mini-animate" },
    { import = "lazyvim.plugins.extras.ui.edgy" },
    -- Language Support
    -- { import = "lazyvim.plugins.extras.lang.typescript" },
    { import = "lazyvim.plugins.extras.lang.json" },
    { import = "lazyvim.plugins.extras.lang.go" },
    -- Coding Support
    { import = "lazyvim.plugins.extras.coding.copilot" },
    -- import/override with your plugins
    { import = "plugins" },
  },

If I toggle edgy, I get the following:

vim/_editor.lua:0: nvim_exec2(): Vim:E492: Not an editor command: SymbolsOutline 

Presumably this is because symbols-outline.nvim is not listed as a dependency anywhere?

Steps To Reproduce

  1. LazyVim config as above.
  2. Open a code file
  3. <leader>-> u -> e

Expected Behavior

No error.

Repro

As above.

The plugin cannot work well when the window might be full-screen.

The edgy.nvim cannot work well with windows which can be full-screen. For example, while starting the neovim with a directory, netrw or nvimtree will be full-screen and the edgy.nvim cannot work well with them.

The minimal init file to reproduce the bug is:

-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
        vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
        vim.fn.system({
                "git",
                "clone",
                "--filter=blob:none",
                "--single-branch",
                "https://github.com/folke/lazy.nvim.git",
                lazypath,
        })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
        -- add any other plugins here
        {
                "folke/edgy.nvim",
                opts = {
                        left = {
                                {
                                        ft = "netrw",
                                },
                        },
                },
        },
}
require("lazy").setup(plugins, {
        root = root .. "/plugins",
})

Then open a directory with neovim

> mkdir test
> nvim -u repro.lua test

The neovim and netrw will be opened normally, but the cursor cannot move as expected, and I cannot open a file by netrw as well.
nvimtree has the similar problem too.

bug: When I use telescope's goto symbol under zen-mode, zen-mode quit

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.5

Operating system/version

macos 14.2.1

Describe the bug

Describe as the title and I'am using lazyvim. I'm guessing this is an edgy problem because when I commented lazyvim's edgy plugin import everything worked fine.
图片
图片

Steps To Reproduce

  1. open a file and start zen-mode.
  2. type ss to(lazyvim) call telescope's goto symbol.
  3. choose a symbol.
  4. then zen mode quited.

Expected Behavior

  1. zen-mode not quit.

Repro

No response

bug: inconsistent folding with dynamic titles / winbar

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM 0.10 nightly

Operating system/version

Arch Linux, 6.5.2-arch1-1

Describe the bug

When using dynamic titles (title = "%{%v:lua.custom_edgy_title()%}"), the width of a window is not calculated properly when folded. This leads to some windows getting wider when folded because highlight attrs / the result of the expr are not accounted for.

Steps To Reproduce

  1. Create an edgy view for a filetype in the bottom or top view (where title width affects folded width).
  2. Create a custom title function in the global namespace
  3. Open the view, and another view next to it so it can be folded (terminal and qf in minimal init)
  4. Fold the view

The width of the folded view will not be the same as the actual text width of the winbar.

Expected Behavior

The window should be folded to the text width of the winbar.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/edgy.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

function _G.custom_edgy_title()
  return "%#EdgyTitle#Test%#*"
end

require("edgy").setup({
  bottom = {
    {
      ft = "qf",
      title = "%{%v:lua.custom_edgy_title()%}",
    },
    {
      ft = "terminal",
      title = "%{%v:lua.custom_edgy_title()%}",
    },
  },
})

vim.api.nvim_create_autocmd("TermOpen", {
  callback = function(ev)
    vim.bo[ev.buf].filetype = "terminal"
  end
})

bug: while loading, the focus is sent back to the main buffer

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev

Operating system/version

archlinux

Describe the bug

When navigating between window on the left panel, the main buffer get the focus again

edgy-bug.mp4

(I would be very interested on the debug method to use there as I have many other bug in my config and I don't think i have an efficient way of debuging thoses)

Steps To Reproduce

  • Run with docker
docker run -w /root -it --rm alpine:edge sh -uelic '
  apk add git lazygit neovim ripgrep alpine-sdk --update
  git clone https://github.com/adelin-b/LazyVim ~/.config/nvim
  cd ~/.config/nvim
  nvim
'
  • Then press <leader>fo (filetree open)

  • c-j / c-k multiple time to move in the left panel, you can use < > for toggling the neotree panels and it will bug on thoses when you c-j and c-k mutiple times in a direction or another.

It will go back to the main buffer

Expected Behavior

It should stay on the left panel

Repro

^ docker command above, if it doesn't work i can try another repro here.

bug: flickering with neo-tree auto expand enabled

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.9.1

Operating system/version

MacOS Ventura 13.4

Describe the bug

When neo-tree auto expand is enabled (e keybinding), If Neo-tree needs to expand due to width of its contents , the screen flickers as the width of the neo-tree sidebar quickly alternates between widths. Here is a video of it occurring.

flicker.mov

Steps To Reproduce

  1. From command line, open a file in a deeply nested directory. This will force Neo-tree to auto expand in the next step.
  2. Open neo-tree, enable auto expand (e).
  3. Move between windows and flickering will begin.
  4. Disable auto expand (e) and flickering will stop.

Expected Behavior

No flickering.

Repro

My lua skills aren't the good. I've tried for the past 30 minutes to come up with a bare minimum config, but I keep hitting a wall. I'm a new user to LazyVim and I'm using the starter kit with edgy extra enabled.

bug: ui is broken

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.9.5

Operating system/version

MacOS lastest

Describe the bug

when I select a terminal buffer on left side panel, edgy.nvim ui is broken.

image

image

Steps To Reproduce

  1. just click terminal buffer...

Expected Behavior

it should be placed under text editor

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/edgy.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Profiles

Did you check the docs?

  • I have read all the edgy.nvim docs

Is your feature request related to a problem? Please describe.

Depending on the task I am doing I'd like to see one layout with some particular panels, or another layout with different panels. For example, I want one layout while developing, or maybe a different layout depending on the thing I am developing, a different one while debugging, a different one while merging the code with git, or even I'd like to disable temporarily edgy and use a "free" layout.

Describe the solution you'd like

I'd like to be able to configure different layouts or disabling edgy (to have a free layout) and switch them using keymaps.

Describe alternatives you've considered

I think that nvim-ide supports several profiles, but I don't want to be forced yo use its panels.

Additional context

No response

bug: Dropbar and Edgy not working together properly

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.10-dev

Operating system/version

Manjaro 6.1.44

Describe the bug

Using LazyVim, with edgy default's config and dropbar default's config an error is thrown.

I have also created an issue in dropbar project, because I am not sure where could be the root's cause:
Bekaboo/dropbar.nvim#72

Steps To Reproduce

  1. Install LazyVim
  2. add dropbar plugin
  3. Open a file
  4. Open neo-tree (with edgy layout)

Expected Behavior

No error is thrown

Repro

No idea how to reproduce with minimal config. The issue appears on a fresh LazyVim config with edgy active and dropbar plugin installed

bug: QuickFix is stuck

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-2284+gf6042d5c3 && NVIM 9.5

Operating system/version

Macos 14.11

Describe the bug

If I open a help window first and then open a quickfix window, it freezes. However, if I adjust the configuration file and place the quickfix window at the top, it opens normally.
If there are other window configurations before the quickfix window, and you open them before opening the quickfix window, you may encounter such issues.

Steps To Reproduce

  1. :help
  2. :copen

Expected Behavior

Open the quickfix window normally

Repro

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable", -- latest stable release
        lazypath,
    })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
    {
        "folke/edgy.nvim",
        event = "VeryLazy",
        init = function()
            vim.opt.laststatus = 3
            vim.opt.splitkeep = "screen"
        end,
        opts = {
            bottom = {
                {
                    ft = "help",
                    size = { height = 20 },
                    -- only show help buffers
                    filter = function(buf)
                        return vim.bo[buf].buftype == "help"
                    end,
                },
                { ft = "qf", title = "QuickFix" },
            },
        },
    }
})

Views don't collapse fully

First of all, check the readme. It's in there :)

To have your views collapse fully, you either need:

  • Neovim stable (edgy.nvim patches Neovim on the fly for this to work)
  • Neovim nightly build from after June 5th 2023 (PR was merged that fixes this)

feature: Synchronize the state of edgy between all tabs

Did you check the docs?

  • I have read all the edgy.nvim docs

Is your feature request related to a problem? Please describe.

I want the opening and closing status of edgy to be synchronized among all tabs, just like the tab.sync configuration item of nvim-tree.

For example

  • If I open the left edgebar in tab1, it can automatically open the left edgebar when switching to tab2.
  • After tab2 closes the left edgebar, it can automatically close the left edgebar after switching to tab1.

Describe the solution you'd like

None.

Describe alternatives you've considered

Maybe be able to configure a synchronous tab configuration for the edgybar in each direction.

Additional context

No response

bug: High CPU usage with invalid config

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.9.2

Operating system/version

Linux 5.15.0-84-generic #93-Ubuntu SMP Tue Sep 5 17:16:10 UTC 2023 GNU/Linux

Describe the bug

Neovim exhibits unusual behavior when an invalid configuration is used. Specifically, instead of encountering an exception during the execution of require"edgy".setup {}, Neovim starts to consume 100% of a CPU's core after certain window manipulations. Additionally, it may freeze on the :q command.

SPOILER

Extensive examination revealed the root of the issue. The utility edgy.util.with_retry fails to increment the retries variable. This results in Neovim entering a perpetual loop of try -> vim.schedule(try) -> vim.schedule(try) ->..., effectively rendering it stuck and not displaying an error message to the user.

Steps To Reproduce

  1. Implement a basic configuration:
local plugs = vim.fn.stdpath("data") .. "/lazy"
local edgy = plugs .. "/edgy.nvim"
vim.opt.runtimepath:append(edgy)
require("edgy").setup({
  // Erroneous configuration
  animate = false,
  bottom = { { ft = "help" }, },
})
  1. Run a clean instance of Neovim using nvim --clean -u /path/to/cfg.lua.
  2. Issue :h cmd.
  3. Monitor CPU usage using ps -eo %cpu,command | grep nvim.
  4. Optionally, try manipulating more windows (may require configuration adjustment) until Neovim becomes unresponsive to input.

Expected Behavior

Neovim should maintain normal CPU usage and not reach 100% consumption.

Repro

local plugs = vim.fn.stdpath("data") .. "/lazy"
local edgy = plugs .. "/edgy.nvim"
vim.opt.runtimepath:append(edgy)
require("edgy").setup({
	-- Erroneous configuration, should be `{ animate = { enabled = false } }`
	animate = false,
	bottom = { { ft = "help" }, },
})

`opts.[direction].title` should accept string and function

Did you check the docs?

  • I have read all the edgy.nvim docs

Is your feature request related to a problem? Please describe.

It would be awesome if opts.[direction].title can accept a string and a function (the functions must return a string).

Two use cases:

bottom = {
    {
        -- Indicate in the windbar which help file is currently open
        title = function() local bufname = vim.api.nvim_buf_get_name(0)
            bufname = vim.fn.fnamemodify(bufname, ':t')
            return string.format('HELP: %s', bufname)
        end,
        ft = 'help',
    },
    {
        -- Indicate whether the location list or quickfix list is currently
        -- displayed
        title = function()
            local loclist = vim.fn.getwininfo(vim.fn.win_getid())[1]['loclist'] == 1
            return loclist and 'LOCATION LIST' or 'QUICKFIX LIST'
        end,
        ft = 'qf',
    }
}

Describe the solution you'd like

opts.[direction].title accepts string and function

Describe alternatives you've considered

Disabling the winbar winbar = false for a filetype and handling it manually with my winbar plugin. However this is a workaround and i'd love to handle all the winbar titles in edgy.nvim

Additional context

No response

bug: Increase, decrease width or pre-defining width doesn't work with the default "left" bar.

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.5 Release

Operating system/version

Arch Linux

Describe the bug

Hello, I'm new to nvim and its plugins. I'm using the lazynvim distribution of nvim. I installed all the optional packages for edgy.nvim and put the default config from here: http://www.lazyvim.org/extras/ui/edgy. There are two problems with that but I will focus on one in this issue.

here is a little snippet:

        {
          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, width = 10},
        },

In that snippet width = 10 does nothing.
Also doing this:

left = {
    size = 30 
},

Does nothing as well.
Using the default keybind space + ctrl + w + < Does nothing as well, but for example same thing for height works as intended.

As a side issue that I think might be related to this: "bottom" edgebar doesn't work at all despite require("edgy").open("bottom"). I'm not sure if they are related but if there is a problem with width related code it may not be able to display it correctly.

Steps To Reproduce

  1. Install lazynvim
  2. Make sure everything is up to date
  3. Copy the default edgy config file
  4. Press "space + c + e"
  5. Press "space + ctrl + w + <"

Expected Behavior

Neo-tree's width decreases or increases.

Repro

-- I didn't understand how to run edge-nvim with this config so I couldn't do anything.

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/edgy.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

feature: Dynamically resize focused window

Did you check the docs?

  • I have read all the edgy.nvim docs

Is your feature request related to a problem? Please describe.

I wanted to be able to resize my terminal's window but in the docs is described that it is not possible to do it manually. It would be really awesome to be able to automatically resize the focused window

Describe the solution you'd like

parametrize the values of the hight/width that a window should take from the other windows close to the given one. Something similar to this: https://github.com/camspiers/lens.vim (please see the video in the documentation)

Describe alternatives you've considered

The alternative I have considered is using the above mentioned plugin (lens) but it seems to have some issues with edgy (or maybe is just my set up)

Additional context

Thanks for doing such a great job!

bug: error when bring up "cmdwin" when edge bar is available

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-2952+g97c0a5241-Homebrew

Operating system/version

MacOS 14.2.1

Describe the bug

So I have edgy.nvim pinned neo-tree files view. When I tried to bring up my command history (:h cmdwin). I get error straight away:

.../jackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/util.lua:70: ...ckieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/edgebar.lua:194: Error executing lua: vim/_editor.lua:0: nvim_exec2(): Vim(wincmd):E11: Invalid in command-line window; <CR> executes, CTRL-C quits       
stack traceback:                                                                                                                                                                                                                                                          
^I[C]: in function 'nvim_exec2'                                                                                                                                                                                                                                           
^Ivim/_editor.lua: in function 'cmd'                                                                                                                                                                                                                                      
^I...ckieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/edgebar.lua:195: in function <...ckieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/edgebar.lua:194>                                                                                                                          
^I[C]: in function 'nvim_win_call'                                                                                                                                                                                                                                        
^I...ckieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/edgebar.lua:194: in function 'layout'                                                                                                                                                                                   
^I...ackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/layout.lua:146: in function 'fn'                                                                                                                                                                                       
^I...ackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/layout.lua:103: in function 'foreach'                                                                                                                                                                                  
^I...ackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/layout.lua:145: in function 'layout'                                                                                                                                                                                   
^I...ackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/layout.lua:182: in function <...ackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/layout.lua:181>                                                                                                                          
^I[C]: in function 'pcall'                                                                                                                                                                                                                                                
^I.../jackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/util.lua:67: in function <.../jackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/util.lua:65>                                                                                                                            
^I[C]: in function 'pcall'                                                                                                                                                                                                                                                
^I.../jackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/util.lua:47: in function <.../jackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/util.lua:46>   

Steps To Reproduce

  1. launch with repro.lua: nvim -u repro.lua
  2. open neotree: :Neotree
  3. open cmdline-window using : followed by <C-f>
  4. error shows

Expected Behavior

no error appears

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/edgy.nvim",
  {
    "nvim-neo-tree/neo-tree.nvim",
    dependencies = {
      "nvim-lua/plenary.nvim",
      "MunifTanjim/nui.nvim",
    },
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
require("neo-tree").setup({})
require("edgy").setup({
  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>f")
      end,
      size = { height = 0.5 },
    },
  },
})

bug: flickering when using symbols outline

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-476+ga217675a6-Homebrew

Operating system/version

MacOS 13.4

Describe the bug

When I use the config example and navigate between different panes, my cursor suddenly gets stuck and things start to flicker. If I remove SymbolsOutline, things seem to go back to normal.

Steps To Reproduce

  1. Use the Example setup
  2. Open a repository (in my case it was my personal repo Rukenshia/saml2aws-auto)
  3. See things go wild

Expected Behavior

I can use the left sidebar correctly

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify('./.repro', ':p')

-- set stdpaths to use .repro
for _, name in ipairs({'config', 'data', 'state', 'cache'}) do
    vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
end

-- bootstrap lazy
local lazypath = root .. '/plugins/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        'git', 'clone', '--filter=blob:none',
        'https://github.com/folke/lazy.nvim.git', lazypath
    })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
    {
        'nvim-neo-tree/neo-tree.nvim', branch = 'v2.x', dependencies = {
            'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
            'MunifTanjim/nui.nvim'
        }, config = true
    }, {'simrat39/symbols-outline.nvim', config = true},
    'folke/tokyonight.nvim', {
        {
            'folke/edgy.nvim', event = 'VeryLazy', opts = {
                bottom = {
                    {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'
                }
            }
        }
    }
}
require('lazy').setup(plugins, {root = root .. '/plugins'})

vim.cmd.colorscheme('tokyonight')
-- add anything else here

feature: Add the hide setting of pinned when edgybar is opened

Did you check the docs?

  • I have read all the edgy.nvim docs

Is your feature request related to a problem? Please describe.

For example, the settings are as follows

left = {
    {
        ft = "neo-tree",
        filter = function(buf)
            return vim.b[buf].neo_tree_source == "filesystem"
        end,
        title = "Neo-Tree",
        size = { width = 0.2, height = 0.5 },
        pinned = true,
        open = function() require("neo-tree.command").execute({ dir = vim.uv.cwd() }) end,
    },
    {
        ft = "neo-tree",
        filter = function(buf)
            return vim.b[buf].neo_tree_source == "git_status"
        end,
        title = "Neo-Tree Git",
        size = { width = 0.2 },
        pinned = true,
        open = function()
            require("neo-tree.command").execute({
                position = "right",
                source = "git_status",
            })
        end,
    },
    {
        ft = "neo-tree",
        filter = function(buf)
            return vim.b[buf].neo_tree_source == "document_symbols"
        end,
        title = "Neo-Tree Document Symbols",
        size = { width = 0.2 },
        pinned = true,
        open = function()
            require("neo-tree.command").execute({
                position = "top",
                source = "document_symbols",
            })
        end,
    },
}

Then, when executing require("edgy").open("left"), edgy will open filesystem, git_status and document_symbols.
I want edgy will auto hide git_status and document_symbols when executing require("edgy").open("left").

Describe the solution you'd like

Maybe can add hide setting for items with pinned and open.

Describe alternatives you've considered

None.

Additional context

No response

big: attempt to index field 'view' (a nil value)

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.9.1

Operating system/version

13.0.1 (22A400)

Describe the bug

Pursuant to attmpting to resolve #27, I added symbols-outline.nvim as a dependency, but, no dice. Now the error is:

vim/_editor.lua:0: nvim_exec2(): Vim(lua):E5108: Error executing lua ...e/nvim/lazy/symbols-outline.nvim/lua/symbols-outline.lua:307: attempt to index field 'view' (a nil value)
stack traceback:
	...e/nvim/lazy/symbols-outline.nvim/lua/symbols-outline.lua:307: in function 'toggle_outline'
	[string ":lua"]:1: in main chunk
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	.../andy/.local/share/nvim/lazy/edgy.nvim/lua/edgy/view.lua:128: in function <.../andy/.local/share/nvim/lazy/edgy.nvim/lua/edgy/view.lua:127>
	[C]: in function 'pcall'
	.../andy/.local/share/nvim/lazy/edgy.nvim/lua/edgy/util.lua:6: in function 'try'
	.../andy/.local/share/nvim/lazy/edgy.nvim/lua/edgy/view.lua:127: in function <.../andy/.local/share/nvim/lazy/edgy.nvim/lua/edgy/view.lua:122>

Also worth noting: I am unable to quit nvim with :q. It simply toggles the first edgy window. I have to :qa for it to work.

Steps To Reproduce

  1. Start from vanilla lazyvim installation
  2. Enable edgy in lazyvim, using the standard ui plugin
  3. create a ~/.config/nvim/lua/plugins/coding.lua file with the following contents:
return {
  {"simrat39/symbols-outline.nvim"},
}
  1. save everything and open some code.

Result:
edgyerror

Expected Behavior

No error

Repro

As above.

bug: Neo-tree in Edgy broken with Neovim nightly~480

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-473+gb3d5138f

Operating system/version

Both Linux and Macos - OS independent

Describe the bug

Starting from neovim/neovim@b3d5138fd, neo-tree in edgy doesn't work quite right.

Prior to this, opening the left sidebar in my config looked like this:
image

After the mentioned commit:
image

Going to investigate further. Wanted to get this noted, though.

Edit: Forgot to note: When using the problem commit, nothing happens after I toggle("left") until I press any additional key.

Steps To Reproduce

  1. use neovim/neovim@b3d5138fd
  2. Use this config for edgy:
	{
		"folke/edgy.nvim",
		event = "VeryLazy",
		opts = {
			options = {
				left = { size = 35 },
				top = { size = 15 },
				bottom = { size = 15 },
				right = { size = 35 },
			},
			exit_when_last = true,
			wo = {
				-- Setting to `true`, will add an edgy winbar.
				-- Setting to `false`, won't set any winbar.
				-- Setting to a string, will set the winbar to that string.
				winbar = false,
				winfixwidth = true,
				winfixheight = true,
				winhighlight = "WinBar:EdgyWinBar",
				spell = false,
				signcolumn = "no",
				statuscolumn = "",
				number = false,
				relativenumber = false,
			},
			keys = {
				["q"] = function(win)
					win:hide()
				end,
				["<c-q>"] = false,
				["Q"] = false,
				["]w"] = false,
				["[w"] = false,
				["]W"] = false,
				["[W"] = false,
				["<c-w>>"] = false,
				["<c-w><lt>"] = false,
				["<c-w>+"] = false,
				["<c-w>-"] = false,
				["<c-w>"] = false,
				["<A-C-j>"] = function(win)
					win:resize("height", 1)
				end,
				["<A-C-k>"] = function(win)
					win:resize("height", -2)
				end,
				["<A-C-h>"] = function(win)
					win:resize("width", 2)
				end,
				-- decrease width
				["<A-C-l>"] = function(win)
					win:resize("width", -2)
				end,
			},
			animate = {
				enabled = false,
			},
			top = {
				{
					ft = "qf",
					title = "QuickFix",
					pinned = true,
					open = ":copen",
					wo = {
						winbar = true,
						winhighlight = "Normal:EdgyQuickfixNormal",
					},
				},
			},
			bottom = {
				{
					ft = "toggleterm",
					size = { height = 0.15 },
					pinned = true,
					open = function()
						local t = require("tt")

						if #t.terminal.TermList == 0 then
							t.terminal:NewTerminal()
							return
						end

						if t:IsOpen() then
							t.terminal:Close()
							return
						end

						t.terminal:Open("last")
					end,
					-- wo = {
					-- 	winhighlight = "Normal:EdgyTermNormal",
					-- },
				},
				{
					ft = "termlist",
					size = { height = 0.15, width = 25 },
				},
				"Trouble",
			},
			left = {
				{
					title = "Buffers",
					ft = "neo-tree",
					size = { height = 0.15 },
					filter = function(buf)
						return vim.b[buf].neo_tree_source == "buffers"
					end,
					pinned = true,
					visible = true,
					wo = {
						height = "15",
						winbar = true,
					},
					open = "Neotree source=buffers position=left",
				},
				{
					title = "File Tree",
					ft = "neo-tree",
					size = { height = 0.85 },
					pinned = true,
					visible = true,
					filter = function(buf)
						return vim.b[buf].neo_tree_source == "filesystem"
					end,
					wo = {
						winbar = true,
					},
					open = "Neotree filesystem position=top",
				},
			},
			right = {
				{
					ft = "Outline",
					visible = false,
					size = { height = 0.25 },
					pinned = true,
					open = "SymbolsOutlineOpen",
					wo = {
						winbar = true,
					},
				},
				{
					ft = "help",
					size = { width = 79 },
					filter = function(buf)
						return vim.bo[buf].buftype == "help"
					end,
					wo = {
						winhighlight = "Normal:EdgyHelpNormal",
					},
				},
			},
		},
	},
  1. require("edgy").toggle("left")
  2. be sad

Expected Behavior

Neo-tree in Edgy to only split on the left

Repro

No response

bug: edgy breaks diffview.nvim layout

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.5

Operating system/version

MacOS 14.1

Describe the bug

When using Edgy and Diff View File History, and then selecting an entry using require("diffview.actions").open_in_diffview()

The diffview layout in the new tab is not correct. The layout should be diff2_horizontal (default), but edgy causes the layout to split vertically.

Steps To Reproduce

  • Open DiffviewFileHistory
  • Select an entry using <C-A-d> or require("diffview.actions").open_in_diffview()

Expected Behavior

Diffview Layout should remain intact (diff2_horizontal or whatever is configured)

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "sindrets/diffview.nvim",
  "folke/edgy.nvim",
  {
    "folke/edgy.nvim",
    opts = {
      bottom = {
        {
          title = "Diff View File History",
          ft = "DiffviewFileHistory",
        },
      },
    },
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

bug: crashes nvim (exit status 134) when trying to animate terminals

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.10.0-dev+492-gb6d2f49b4

Operating system/version

Fedora release 39 (Rawhide)

Describe the bug

nvim will crash if the plugin attempts to animate the resize of terminals. it's a bit tough for me to isolate the exact steps to repro tho, sometimes it won't animate but sometimes it does

Steps To Reproduce

  1. <C-/> 2<C-/> 3<C-/>
  2. See crash

Expected Behavior

Either not doing the animation or without crashing nvim.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "folke/edgy.nvim",
    opts = {
      bottom = {
        {
          ft = "toggleterm",
          size = { height = 0.4 },
          filter = function(buf, win)
            return vim.api.nvim_win_get_config(win).relative == ""
          end,
        },
      }
    }
  },
  {
    "akinsho/toggleterm.nvim",
    config = function(_, opts)
      require("toggleterm").setup(opts)
    end,
    ---@type ToggleTermConfig
    opts = {
      open_mapping = "<c-/>",
      autochdir = true,
    },
    cmd = "ToggleTerm",
    ---@type LazyKeys{}
    keys = {
      "<c-/>",
    },
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

feature: Hide and Show Edgy Windows While Preserving Content

Did you check the docs?

  • I have read all the edgy.nvim docs

Is your feature request related to a problem? Please describe.

I've configured edgy.nvim to display help, trouble, manpage, and quickfix windows. Due to limited screen space, there are times when I'd like to temporarily hide the edgy window to focus on my codebase, only to return to, for example, the help menu later. Unfortunately, the current functionality doesn't allow hiding the edgy window without closing its content. While the require("edgy").toggle(pos?) API function exists, it only toggles pinned views, and there's no direct way to restore a specific help or manual buffer that was being read.

Additionally, there is the "hide" keymap, yet its functionality differs from the desired behavior. While it effectively collapses within the edgbar, it doesn't contribute to expanding available screen space. Instead, it simply makes more room for other edgy configured windows within the existing display layout.

I appreciate edgy's unified concept, especially the ability to close every configured window with q. It would be beneficial if there were a command to toggle every edgy window without losing its content, providing a seamless way to manage visibility without disrupting the current state of individual buffers.

Describe the solution you'd like

I propose the inclusion of two new functions in the edgy.nvim API:

-- This function would be designed to hide the edgbar at a specified 
-- position without removing its content.
require("edgy").hide(pos?)

-- This function would facilitate the display of the hidden edgbar at 
-- the specified position, restoring its visibility.
require("edgy").show(pos?)

Furthermore, for consistency in naming conventions, the existing keymap:

["<c-q>"] = function(win) win:hide() end

-- could be more aptly renamed to:

["<c-q>"] = function(win) win:collapse() end

This adjustment aims to provide a clearer and more cohesive naming structure for keymap actions within the edgy.nvim configuration.

Describe alternatives you've considered

I've explored the idea of creating a custom keymap to minimize the edgy window:

["<c-w>_"] = function(win)
    win:resize("height", [min value])
end,

However, the result doesn't look very nice to me.

Additional context

No response

bug: cannot use toggleterm's float term

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-449+gcc41697775

Operating system/version

Arch linux

Describe the bug

after using edgy, I cannot use toggleterm's float term.

simplescreenrecorder-2023-06-06_22.34.50.mp4

Steps To Reproduce

run :ToggleTerm direction=float in nvim

Expected Behavior

Use float term normally

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
	"folke/tokyonight.nvim",
	{
		"folke/edgy.nvim",
		opts = {
			bottom = {
				{ ft = "toggleterm", size = { height = 0.4 } },
			},
		},
	},
	{ "akinsho/toggleterm.nvim", opts = {} },
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")

bug: missing border character upon open

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.9.1 and NVIM v0.10.0-dev-695+g58f948614

Operating system/version

MacOS Ventura 13.4

Describe the bug

The last vertical bar for the border is not initially drawn. Most often, I see an empty space character where the border should be, but it simply depends on the width/height of the terminal and contents of the main buffer. Here are a few examples:

Icon from starter shown when term size is 25x111:
image

Space char shown when term size is 25x119 chars:
image

But as soon as you resize the window or open one of the sections, the character is drawn correctly. For example, in the below image, I simply made the terminal wider and then shorter again to the original size:
image

Note: This is easy to overlook with the standard border color of Tokyonight when a space character takes the place of the border. But I prefer a slightly brighter border to help distinguish my windows in vim, so I set my Tokyonight border color to the same color as comments. And that's when it stood out like a sore thumb.

Steps To Reproduce

  1. Open a terminal and set its size to 25x111 characters (stty size).
  2. Open neovim with the standard starter screen from LazyVim.
  3. Open neo-tree using <leader>e.
  4. You should see the icon I see in the screen shot.

To fix, simply resize the terminal window or open the neo-tree Buffers section.

I have tested with the latest nightly version from nvim as one of the prior issues stated that an upstream fix was posted, so I was unsure if that might be related, so I tested both 0.9.1 as well as nightly neovim. Problem happens on both.

Expected Behavior

I expect it to draw the full border as in the screenshot above.

Repro

I am struggling to create a simple config (my Lua Nvim skills aren't so great).
I was able to reproduce with a LazyVim starter kit with only the edgy extra enabled.

bug: Help window not displayed in edgy after following tags

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.9.4 Build type: Release LuaJIT 2.1.1696795921

Operating system/version

MacOs 13.4.1

Describe the bug

I've set up the help window to be displayed in edgy.nvim. When navigating between help files using <C-]> to follow tags, the new help files no longer appear to be an edgy window. This is noticeable through changes in the winbar, and the default keymap q to close the window ceases to work.

Steps To Reproduce

  1. nvim --clean -u repro.lua
  2. :help :cnext
  3. /switchbuf<cr>
  4. <C-]>

--> new helpfile is no edgy window

Expected Behavior

the jumped helpfile is still an edgy window

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
    "folke/tokyonight.nvim",
    {
        "folke/edgy.nvim",
        opts = {
            bottom = {
                { ft = 'help' },
            }
        }
    },
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")

feature: dynamic title

Did you check the docs?

  • I have read all the edgy.nvim docs

Is your feature request related to a problem? Please describe.

I wish to have dynamic title for my quick fix windows, e.g., I open diagnostics in qf then my title should be Diagnostics, I open buffers in qf, then my title should be buffers, etc.

Describe the solution you'd like

title field could be a function that returns a string, this way every time a new window is opened, title string could be obtained from this function.

Describe alternatives you've considered

none -

Additional context

No response

feature: Window title

Did you check the docs?

  • I have read all the edgy.nvim docs

Is your feature request related to a problem? Please describe.

I use edgy as a left-side pane to have different cwd-dependent views, e.g., a file tree, a tree of modified files as tracked by git and a tree of open buffers. I use neo-tree sources to display these. However, I find the hide_root_node option of neo-tree quite handy, as I see the redundant root node always displaying the cwd for all views. By hiding the root node, I don't waste horizontal nor vertical space on this information, but it would be good to have it at the top of the whole edgy sidebar.

Not hiding the root nodes:
Screenshot 2023-07-19 at 23 01 56

Hiding the root nodes:
Screenshot 2023-07-19 at 23 01 31

Describe the solution you'd like

It'd be great to add a title option to the windows, i.e., to left, right, top and bottom.

Describe alternatives you've considered

Using the bufferline title to display this information.

Additional context

No response

bug: E11: Invalid in command-line window; <CR> executes, CTRL-C quits

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.9.4 and v0.10.0-dev-366d0c7

Operating system/version

Arch Linux

Describe the bug

Getting this error message when trying to open command line window (q:):

Error detected while processing BufWinEnter Autocommands for "*":
.../user/.local/share/nvim/lazy/edgy.nvim/lua/edgy/util.lua:70: ...er/.local/share/nvim/lazy/edgy.nvim/lua/edgy/edgebar.lua:207: Error executing lua: vim/_editor.lua:0: BufWinEnter Autocommands for "*"..script nvim_exec2() called at BufWinEnter Autocommands for "*":0: Vim(wincmd):E11
: Invalid in command-line window; <CR> executes, CTRL-C quits
stack traceback:
^I[C]: in function 'nvim_exec2'
^Ivim/_editor.lua: in function 'cmd'
^I...er/.local/share/nvim/lazy/edgy.nvim/lua/edgy/edgebar.lua:208: in function <...er/.local/share/nvim/lazy/edgy.nvim/lua/edgy/edgebar.lua:207>
^I[C]: in function 'nvim_win_call'
^I...er/.local/share/nvim/lazy/edgy.nvim/lua/edgy/edgebar.lua:207: in function 'layout'
^I...ser/.local/share/nvim/lazy/edgy.nvim/lua/edgy/layout.lua:146: in function 'fn'
^I...ser/.local/share/nvim/lazy/edgy.nvim/lua/edgy/layout.lua:103: in function 'foreach'
^I...ser/.local/share/nvim/lazy/edgy.nvim/lua/edgy/layout.lua:145: in function 'layout'
^I...ser/.local/share/nvim/lazy/edgy.nvim/lua/edgy/layout.lua:182: in function <...ser/.local/share/nvim/lazy/edgy.nvim/lua/edgy/layout.lua:181>
^I[C]: in function 'pcall'
^I.../user/.local/share/nvim/lazy/edgy.nvim/lua/edgy/util.lua:67: in function <.../user/.local/share/nvim/lazy/edgy.nvim/lua/edgy/util.lua:65>
^I[C]: in function 'pcall'

Steps To Reproduce

  1. Open any window that Edgy moves into the layout.
  2. Open command line window by pressing q:.

Expected Behavior

No error is expected.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
	"folke/edgy.nvim",
        opts = {
            -- The same error occurs with other layout positions and filetypes as well.
            bottom = {
                {
                    ft = "help",
                    size = { height = 0.5 }
                }
            }
        }
  }
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.