Skip to content

andriidemus/ZellijLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Zellij Link

Sublime Text 4 plugin for Zellij interaction.

Inspired by SendText.

Features

  • simple Zellij session configuration
  • start/restart configured Zellij tabs
  • send any selected text to a target Zellij tab
    • file type -> zellij tab configuration in .subl-zellij
    • buffer -> zellij tab binding with "Bind Buffer to Zellij Tab" command

All supported commands

Configuration file

Config file format is Python dictionary. ZellijLink tries to find .subl-zellij file starting from current location up to filesystem root. Current location is either directory of file from active buffer, or directory, currently opened with ST.

Sample:

{
    "session": "test-session",
    "cwd": "some_subdir",
    "tabs": {
        "clj-repl": {
            "cmd": ["clj"],
        },
    },
    "send": {
        "Clojure (Sublimed)": "clj-repl",
    },
}

Demo

Run preconfigured tab

run_tab

Send selected

send_selected

Bind buffer to Zellij tab

send_to_bound

Custom commands

Plugin code may be reused for custom commands, like reloading clojure file in REPL:

import os
import ZellijLink.zellij as zellij

class ReloadCljFileInRepl(sublime_plugin.TextCommand):
    def run(self, edit):
        file = self.view.file_name()
        if file:
            (_, ext) = os.path.splitext(file)
            if ext.startswith(".clj"):
                path = os.path.realpath(file)
                repl_str = '(load-file "' + path + '")'
                zellij.send_text(repl_str)

load_file

About

SublimeText Plugin for Zellij interaction

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages