Skip to content

laperlej/zellij-choose-tree

Repository files navigation

zellij-choose-tree

showcase.webm

zellij-choose-tree is a plugin for zellij that allows users to quickly switch between sessions.

It is inspired by tmux choose-tree accessible with Ctrl+b s by default.

Usage

  • Up/Down k/j arrow keys to navigate
  • Left/Right h/l to fold/unfold to reveal tabs/panes
  • x to delete selected session (tab/pane deletion not supported yet)
  • Enter to switch to selected session/tab/pane
  • 1-9 A-Z to switch to session/tab/pane without navigating

Installation

Download zellij-choose-tree.wasm from the latest release and place it in your zellij plugins folder.

mkdir -p ~/.config/zellij/plugins
wget https://github.com/laperlej/zellij-choose-tree/releases/latest/download/zellij-choose-tree.wasm -O ~/.config/zellij/plugins/zellij-choose-tree.wasm

Configuration

Add the plugin to a keybinding in your config.toml.

In this example, the keybinding is bound to s in tmux mode.


tmux {
    # other keybinds here ...
    bind "s" { LaunchOrFocusPlugin "file:~/.config/zellij/plugins/zellij-choose-tree.wasm" {
            floating true
            move_to_focused_tab true
            show_plugins false
        }; SwitchToMode "Locked";
    }
}

Optional arguments:

  • show_plugins true|false: display/hide the plugin panes, default is false

Use as a sessionpicker

This plugin can also act as a sessionpicker when called through a pipe.

In your config file:

plugins {
    // other plugins here ...
    sessionpicker location="file:~/.config/zellij/plugins/zellij-choose-tree.wasm"
}

From the command line:

zellij pipe --plugin sessionpicker

The name of the selected session will be returned.

Other plugins can also call this plugin through a pipe in the same way.

Contributing

Contributions are welcome. Please open an issue or a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.