Skip to content

Instantly share code, notes, and snippets.

@Viniciuscarvalho
Created January 29, 2026 12:28
Show Gist options
  • Select an option

  • Save Viniciuscarvalho/8775e1cdc38ab91c87a9767e7bbf02a5 to your computer and use it in GitHub Desktop.

Select an option

Save Viniciuscarvalho/8775e1cdc38ab91c87a9767e7bbf02a5 to your computer and use it in GitHub Desktop.
Setup for Zellij CLI
// ============================================================================
// iOS Development Layout for Zellij + xcodebuild.nvim
// ============================================================================
//
// Usage: zellij --layout ~/.config/zellij/layouts/ios-dev.kdl
//
// Layout: 70/30 split following community best practices
//
// Keybindings (inside Neovim with xcodebuild.nvim):
// <leader>X - Main picker
// <leader>xb - Build project
// <leader>xr - Build & Run
// <leader>xt - Run tests
// <leader>xT - Run current test class
// <leader>xl - Toggle build logs
// <leader>xe - Toggle test explorer
// <leader>xc - Toggle code coverage
// <leader>xd - Select device/simulator
// <leader>xp - SwiftUI preview
//
// Tabs:
// 1. Coding - Main development (nvim + tools)
// 2. Simulator - Device/simulator management
// 3. Git - Version control (lazygit)
// 4. Terminal - General purpose shell
//
// ============================================================================
layout {
// Default tab template with consistent tab-bar and status-bar
default_tab_template {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
children
pane size=1 borderless=true {
plugin location="zellij:status-bar"
}
}
// ========================================================================
// TAB 1: Coding - Main development workspace
// ========================================================================
// Layout: 60% editor | 40% tools (stacked: terminal, logs, tests)
tab name="Coding" focus=true {
pane split_direction="vertical" {
// Left: Editor (60%)
pane size="60%" {
command "nvim"
args "."
}
// Right: Tools stack (40%)
pane size="40%" stacked=true {
pane name="Terminal"
pane name="Build Logs" {
command "bash"
args "-c" "echo ' Build Logs - Use <leader>xl in nvim to toggle xcodebuild logs'; echo ''; echo ' Or run: xcodebuild -project *.xcodeproj -scheme <scheme> build 2>&1 | xcbeautify'; exec bash"
}
pane name="Test Explorer" {
command "bash"
args "-c" "echo ' Test Explorer - Use <leader>xe in nvim to toggle'; echo ''; echo ' Quick commands:'; echo ' <leader>xt - Run all tests'; echo ' <leader>xT - Run current test class'; echo ' <leader>x. - Repeat last test'; exec bash"
}
pane command="claude" focus=true
}
}
}
// ========================================================================
// TAB 2: Simulator - Device and simulator management
// ========================================================================
// Layout: 50% simulators | 50% devices
tab name="Simulator" {
pane split_direction="vertical" {
// Left: iOS Simulators
pane size="50%" name="Simulators" {
command "bash"
args "-c" "echo ' iOS Simulators'; echo ' =============='; echo ''; xcrun simctl list devices available | head -40; echo ''; echo ' Commands:'; echo ' xcrun simctl boot <device-id> - Boot simulator'; echo ' xcrun simctl shutdown <device-id> - Shutdown simulator'; echo ' xcrun simctl erase <device-id> - Erase simulator'; echo ' open -a Simulator - Open Simulator.app'; echo ''; exec bash"
}
// Right: Physical devices
pane size="50%" name="Devices" {
command "bash"
args "-c" "echo ' Physical Devices (pymobiledevice3)'; echo ' =================================='; echo ''; if command -v pymobiledevice3 &> /dev/null; then pymobiledevice3 usbmux list 2>/dev/null || echo ' No devices connected'; else echo ' pymobiledevice3 not in PATH'; echo ' Add to ~/.zshrc: export PATH=\"$HOME/Library/Python/3.9/bin:$PATH\"'; fi; echo ''; exec bash"
}
}
}
// ========================================================================
// TAB 3: Git - Version control
// ========================================================================
tab name="Git" {
pane {
command "lazygit"
}
}
// ========================================================================
// TAB 4: Terminal - General purpose
// ========================================================================
tab name="Terminal" {
pane focus=true
}
// ========================================================================
// NEW TAB TEMPLATE
// ========================================================================
new_tab_template {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
pane
pane size=1 borderless=true {
plugin location="zellij:status-bar"
}
}
// ========================================================================
// SWAP LAYOUTS - Press Ctrl+P then W to cycle through layouts
// ========================================================================
// Vertical split: editor left, tools right
swap_tiled_layout name="vertical" {
tab max_panes=4 {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
pane split_direction="vertical" {
pane size="70%"
pane size="30%" {
children
}
}
pane size=1 borderless=true {
plugin location="zellij:status-bar"
}
}
}
// Horizontal split: editor top, tools bottom
swap_tiled_layout name="horizontal" {
tab max_panes=4 {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
pane split_direction="horizontal" {
pane size="70%"
pane size="30%" split_direction="vertical" {
children
}
}
pane size=1 borderless=true {
plugin location="zellij:status-bar"
}
}
}
// Stacked: editor with stacked tools panel
swap_tiled_layout name="stacked" {
tab min_panes=3 {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
pane split_direction="vertical" {
pane size="70%"
pane size="30%" stacked=true {
children
}
}
pane size=1 borderless=true {
plugin location="zellij:status-bar"
}
}
}
// ========================================================================
// FLOATING LAYOUTS
// ========================================================================
swap_floating_layout name="staggered" {
floating_panes
}
swap_floating_layout name="enlarged" {
floating_panes max_panes=5 {
pane {
x "5%"
y 1
width "90%"
height "90%"
}
pane {
x "5%"
y 2
width "90%"
height "90%"
}
pane {
x "5%"
y 3
width "90%"
height "90%"
}
pane {
x "5%"
y 4
width "90%"
height "90%"
}
pane {
x "5%"
y 5
width "90%"
height "90%"
}
}
}
swap_floating_layout name="spread" {
floating_panes max_panes=2 {
pane {
x "1%"
y "25%"
width "45%"
}
pane {
x "50%"
y "25%"
width "45%"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment