Sublime Text 4 plugin for Zellij interaction.
Inspired by SendText.
- 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
- file type -> zellij tab configuration in
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",
},
}
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)