Skip to content

Instantly share code, notes, and snippets.

@sinux-l5d
Last active June 15, 2024 22:15
Show Gist options
  • Save sinux-l5d/f695d5c31377616d091be2044977b936 to your computer and use it in GitHub Desktop.
Save sinux-l5d/f695d5c31377616d091be2044977b936 to your computer and use it in GitHub Desktop.
Zellij setup for rustlings exercises
#!/usr/bin/env bash
zellij action new-tab --layout rustlings_layout.kdl
layout {
tab name="Rustlings" {
pane size=1 borderless=true {
plugin location="tab-bar"
}
pane split_direction="vertical" {
pane {
name "Editor"
focus true
command "zsh"
args "-c" r#"while true; do file=$(~/.cargo/bin/rustlings list | grep Pending | awk '{print $2}' | head -1); if [[ -n $file ]]; then vim "$file"; else break; fi; done"#
}
pane split_direction="horizontal" {
pane {
name "Exercise"
command "~/.cargo/bin/rustlings"
args "watch"
}
pane {
name "Hint"
size 15
command "zsh"
start_suspended true
args "-c" r#"~/.cargo/bin/rustlings list | grep Pending | awk '{print $1}' | head -1 | xargs ~/.cargo/bin/rustlings hint"#
}
}
}
pane size=2 borderless=true {
plugin location="status-bar"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment