Open gozes opened 1 year ago
May I add that with plugin system, it becomes more important because you can configure them.
As an example, I use https://github.com/dj95/zjstatus/ and now that I have a status bar configured, I need to copy-paste it into each layout. Each time I change a setting, I need to manually propagate it by copy-pasting into all existing layout. This is both error-prone and time-consuming.
Having an import would allow writing layout like this:
layout {
import location="panes/basic.kdl"
pane {
import location="panes/editor.kdl"
pane
}
import location="statusbar.kdl"
floating_panes {
import location="overlay.kdl"
}
}
The same mechanism for templates would be just perfect:
layout {
pane_template name="status-bar location="statusbar.kdl"
tab {
pane
status-bar
}
tab {
pane
status-bar
}
}
Any news regarding this?
I have a similar use case with zjstatus
. It would be nice to either have remote configuration for plugins or being able to reference templates in external files. My zjstatus
bar is around 60 lines, and I want it in each of my layouts.
I have a similar use case with
zjstatus
. It would be nice to either have remote configuration for plugins or being able to reference templates in external files. Myzjstatus
bar is around 60 lines, and I want it in each of my layouts.
Have you tried using plugin aliases? You can set zjstatus
configured there and then use the alias in all your layouts.
@cristiand391 That's actually what I was looking for, thank you! So, a layout would be defined as this...
layout {
pane size=1 borderless=true {
plugin location="zjstatus"
}
pane
}
with all the config in the alias...
plugins {
zjstatus location="https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm" {
format_left "{session} {tabs}"
...
}
}
It would be great if I could create a layout template under
zellij/layouts
and be able to import/reference them in a layout so that I can construct a layout for a given project using does template instead of having to either redeclare the temple on each project or copy a layout from another project.The use case I'm thinking of is that at the moment I have a number of go projects I work on every day but they all share very similar commands that I want to run in the project. For example for running the test it will always be
make test
even when each may have a different command that gets run by make. It would be awesome if I could declarepane_template
for the go test command that I can reference in thelayout.kdl
in the project so that is one less pane I have to make for each go project.This is a simplistic example that just runs a make command but you can imagine how you can have many of this small
pane_template
for whatever tech stack you are working with that will allow you to construct a layout for a given project using this "building blocks" + whatever other "custom" panes you need for the specific project