Coder Social home page Coder Social logo

zellij-workspace's Introduction

Zellij Workspace

A Zellij plugin for opening single or multi tabs layouts within an existing zellij session.

Why?

For example if you are using a terminal text editor (helix, neovim, etc), you can use zellij layouts to open mulitple repo in your editor in separate tabs.

zellij-workspace allows to list all of your layouts in a .zellij-workspace file, fuzzy find layout, and apply the layout to the existing session.

Select a layout:

Layouts

Apply layout to session:

Session

Requirements

Zellij version v0.38.0 or later.

Zellij Plugin Permission

Permission Why
ReadApplicationState Subscribe to Pane and tab events
ChangeApplicationState Setting plugin pane name, creating new tabs

Host Filesystem Access

Zellij maps the folder where Zellij was started to /host path on the plugin (e.g. your home dir or default_cwd in your zellij or the current dir where you started your zellij session).

The plugin will look for a /host/.zellij-workspace file (i.e. at the root of the dir of you current zellij session) to load a list of zellij layouts (relative path from your zellij session cwd).

Example of a .ghost file:

.config/zellij/layouts/my_custom_layout.kdl
## this is a comment starting with '#'
	# this is also a comment



## empty lines are also ignored
.config/zellij/layouts/another_layout.kdl

Install

Download WASM Binary

  • Download zellij-workspace.wasm binary from release page.
  • Verify binary signature with cosign (see instruction bellow)
  • copy binary to zellij plugin dir:
    • mv target/wasm32-wasi/release/zellij-workspace.wasm ~/.config/zellij/plugins/

Validate Signature With Cosign

Make sure you have cosign installed locally (see Cosign Install).

Then you can use the ./verify_signature.sh in this repo:

./verify_signature.sh PATH_TO_DOWNLOADED_ARCHIVE TAG_VERSION

for example

$ ./verify_signature.sh ~/Downloads/zellij-workspace.wasm v0.1.0

Checking Signature for version: v0.1.0
Verified OK

Build from source

WARNING: requires to have rust installed and wasm rustup target add wasm32-wasi

  • git clone [email protected]:vdbulcke/zellij-workspace.git
  • cd zellij-workspace
  • cargo build --release
  • mv target/wasm32-wasi/release/zellij-workspace.wasm ~/.config/zellij/plugins/

Loading plugin

Via Zellij Config

shared_except "locked" {
    bind "Ctrl y" {
        LaunchOrFocusPlugin "file:~/.config/zellij/plugins/zellij-workspace.wasm" {
            floating true

            debug false                     // display debug info, config, parse command etc
        }
    }
}

Via CLI

zellij action launch-or-focus-plugin --floating "file:$HOME/.config/zellij/plugins/zellij-workspace.wasm"

zellij-workspace's People

Contributors

vdbulcke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.