Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More built-in plugins #1398

Open
3 tasks
imsnif opened this issue May 10, 2022 · 11 comments
Open
3 tasks

More built-in plugins #1398

imsnif opened this issue May 10, 2022 · 11 comments
Labels
plugin system Enhancement or fixes related to plugin system
Milestone

Comments

@imsnif
Copy link
Member

imsnif commented May 10, 2022

In order to encourage the Zellij community to write more plugins, we should create more built-in plugins (in addition to the interface and Strider plugins we have now). These plugins will also serve much needed purposes in the Zellij UX:

  • A plugin that will allow users to switch between sessions at runtime
  • A plugin that will allow users to load and switch between different layouts at runtime
  • A plugin that will allow users to search in the scroll-buffer of multiple panes for a certain string

Depends on: #1397

@imsnif imsnif added the plugin system Enhancement or fixes related to plugin system label May 10, 2022
@imsnif imsnif added this to the Roadmap milestone May 10, 2022
@amtoine
Copy link

amtoine commented Jul 17, 2023

  • A plugin that will allow users to switch between sessions at runtime

we've started working on this first point with @silicakes in silicakes/zellij-sessionizer 😋

i've been able to write a plugin that detaches from the current session, from the CLI: amtoine/zellij-plugin-detach

the only problem we still have is to run the detaching and the reattaching in sequence in the same script... 🤔
TL;DR: the reattaching never happens 😕

@imsnif
Copy link
Member Author

imsnif commented Jul 17, 2023

@amtoine - cool efforts! Yes, zellij needs more capabilities in core for such a plugin. It is being worked on (both the capabilities and the plugin)... so just a heads up so that your efforts will not go to waste!

@amtoine
Copy link

amtoine commented Jul 17, 2023

cool efforts! Yes, zellij needs more capabilities in core for such a plugin. It is being worked on (both the capabilities and the plugin)... so just a heads up so that your efforts will not go to waste!

amazing, these are good news 😊

i'm not sure i'll have time to work on this anyway... but please use the two links above as much as possible if that can help you guys 🙏

can't wait to have a fully working zellij switch-session command in the future 🤩

@demestoss
Copy link

demestoss commented Oct 24, 2023

Hey!

I've recently switched from Tmux to Zellij and I am super excited about it. It has flexible layout configs out of the box and convenient mode switching which I like a lot

I love my Tmux+Zoxide+FZF configuration for easily starting sessions
So I've started working on my own zellij session management script demestoss/zellij-smart-sessionizer

It is powered by Zoxide+Fzf is capable of selecting layouts for the sessions and totally usable 😄
Also, you can run it inside Zellij to open a new tab with the selected path and layout

Will work on it and try to improve, cause it's my primary multiplexer now.
You can check the video of usage inside the repo

Looking forward to the zellij switch-session functionality to improve current implementation ☘️

@agluck91
Copy link

agluck91 commented Nov 10, 2023

@amtoine @imsnif I was also interested in writing this plugin. It is one of the main things that makes it difficult for me to go full on Zellij, I am still primarily in tmux. Is the majority of this work still happening on @silicakes repo? I would like to go to a central point so I am not doubling up a bunch of effort.

Update: I was getting close with a bash script option to switch "sessions" based on layouts now which I think is going to be FAR superior to the tmux way of doing it. It looks like @demestoss has already got it finished! HAHA The bane around it all is having to manually detach the session and load the layout.

@amtoine
Copy link

amtoine commented Nov 10, 2023

@agluck91
afaik this feature has been added in Zellij 0.38 😋

@silicakes
Copy link

silicakes commented Nov 11, 2023

@amtoine @imsnif I was also interested in writing this plugin. It is one of the main things that makes it difficult for me to go full on Zellij, I am still primarily in tmux. Is the majority of this work still happening on @silicakes repo? I would like to go to a central point so I am not doubling up a bunch of effort.

Update: I was getting close with a bash script option to switch "sessions" based on layouts now which I think is going to be FAR superior to the tmux way of doing it. It looks like @demestoss has already got it finished! HAHA The bane around it all is having to manually detach the session and load the layout.

Hi, and thanks for mentioning our project @amtoine!

I'll gladly accept pull requests for any new features, however indeed the latest version of zellij, 0.38, supports session management via ctrl/cmd+o+w which is why I decided to call it 'Cow'.

AFAIK, Cow misses the ability to kill sessions and remove them from the persistent session registry, but I recon it's only a matter of time until it lands.

With that said, I think the point of the various sessionization solutions are when coming from outside of zellij and I think that https://github.com/silicakes/zellij-sessionizer gives you this exact experience 🙏

@agluck91
Copy link

I would like to add functionality to be able to call those session functions from Zellij actions so sessions can be switched too from inside an already running session with keyboard shortcuts.

@Andrew15-5
Copy link

I also want to have the ability to quickly switch between sessions via keyboard shortcuts. Maybe just add:

keybinds { 
   session {
        bind "1" { GoToSession 1; SwitchToMode "Normal"; }
        bind "2" { GoToSession 2; SwitchToMode "Normal"; }
        bind "3" { GoToSession 3; SwitchToMode "Normal"; }
        bind "4" { GoToSession 4; SwitchToMode "Normal"; }
        bind "5" { GoToSession 5; SwitchToMode "Normal"; }
        bind "6" { GoToSession 6; SwitchToMode "Normal"; }
        bind "7" { GoToSession 7; SwitchToMode "Normal"; }
        bind "8" { GoToSession 8; SwitchToMode "Normal"; }
        bind "9" { GoToSession 9; SwitchToMode "Normal"; }
    }
}

The same way it is implemented with tabs:

keybinds {
    tab {
        bind "1" { GoToTab 1; SwitchToMode "Normal"; }
        bind "2" { GoToTab 2; SwitchToMode "Normal"; }
        bind "3" { GoToTab 3; SwitchToMode "Normal"; }
        bind "4" { GoToTab 4; SwitchToMode "Normal"; }
        bind "5" { GoToTab 5; SwitchToMode "Normal"; }
        bind "6" { GoToTab 6; SwitchToMode "Normal"; }
        bind "7" { GoToTab 7; SwitchToMode "Normal"; }
        bind "8" { GoToTab 8; SwitchToMode "Normal"; }
        bind "9" { GoToTab 9; SwitchToMode "Normal"; }
    }
}

@Andrew15-5
Copy link

Andrew15-5 commented Dec 20, 2023

BTW, I was able to achieve "kinda the same" result by doing:

    shared_except "session" "locked" {
        bind "Ctrl o" { SwitchToMode "Session"; }
        bind "Alt s" {
            LaunchOrFocusPlugin "zellij:session-manager" {
                floating true
                move_to_focused_tab true
            };
            SwitchToMode "Normal";
        }
    }

And if I rename all my sessions (manual labor! Gah!) with <number> <title> then I can press Alt+s > <number> > Enter, which is fast enough for now, but in theory the search can select a tab or a pane instead of a session + I don't want to press Enter to confirm the switch, so it's not ideal.

@Peeeaje
Copy link

Peeeaje commented Apr 21, 2024

@imsnif @amtoine @agluck91
I wrote pretty basic sesion switch plugin thanks to recent update.
https://github.com/Peeeaje/zellij-switch-session

Does that help you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin system Enhancement or fixes related to plugin system
Projects
None yet
Development

No branches or pull requests

7 participants