|
|
@ -1,7 +1,11 @@
|
|
|
|
#!/bin/env nu
|
|
|
|
#!/bin/env nu
|
|
|
|
|
|
|
|
|
|
|
|
def main [] {
|
|
|
|
def main [] {
|
|
|
|
zellij --layout {{dirs.config}}/zellij/development.toml
|
|
|
|
if $env.ZELLIJ? == null {
|
|
|
|
|
|
|
|
zellij --layout {{dirs.config}}/zellij/development.toml --session (session-name)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
zellij action new-tab --layout {{dirs.config}}/zellij/development.toml --name (tab-name)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def `main open-file` [path: string] {
|
|
|
|
def `main open-file` [path: string] {
|
|
|
@ -21,3 +25,20 @@ def open-editor [path: string] {
|
|
|
|
def open-image [path: string] {
|
|
|
|
def open-image [path: string] {
|
|
|
|
zellij ac new-pane -f -- chafa -C on --scale max $path
|
|
|
|
zellij ac new-pane -f -- chafa -C on --scale max $path
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def session-name [] {
|
|
|
|
|
|
|
|
let dirname = $env.PWD | path parse | get stem
|
|
|
|
|
|
|
|
let suffix = ( zellij list-sessions -s
|
|
|
|
|
|
|
|
| split row "\n"
|
|
|
|
|
|
|
|
| where $it =~ $"ide-($dirname)"
|
|
|
|
|
|
|
|
| first
|
|
|
|
|
|
|
|
| hash md5
|
|
|
|
|
|
|
|
| str substring 0..4
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
$"ide-($dirname)-($suffix)"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def tab-name [] {
|
|
|
|
|
|
|
|
let dirname = $env.PWD | path parse | get stem
|
|
|
|
|
|
|
|
$"Editor \(($dirname)\)"
|
|
|
|
|
|
|
|
}
|
|
|
|