folke / edgy.nvim

Easily create and manage predefined window layouts, bringing a new edge to your workflow
Apache License 2.0
783 stars 14 forks source link

feature: dynamic title #43

Closed Chaitanyabsprip closed 9 months ago

Chaitanyabsprip commented 11 months ago

Did you check the 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

willothy commented 10 months ago

You can use regular winbar syntax to call a function in the title, such as %{%v:lua.custom_title()%}. Once #46 is merged, the width will be calculated properly for format strings. Hope that helps