Skip to content

Instantly share code, notes, and snippets.

@wayanjimmy
Created April 11, 2026 10:24
Show Gist options
  • Select an option

  • Save wayanjimmy/5f62842e2879d11a614091f0b1993fa3 to your computer and use it in GitHub Desktop.

Select an option

Save wayanjimmy/5f62842e2879d11a614091f0b1993fa3 to your computer and use it in GitHub Desktop.
My Zellij configuration
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
keybinds {
normal {
// uncomment this and adjust key if using copy_on_select=false
// bind "Alt c" { Copy; }
}
locked {
bind "Ctrl g" { SwitchToMode "Normal"; }
}
resize {
bind "Ctrl n" { SwitchToMode "Normal"; }
bind "h" "Left" { Resize "Increase Left"; }
bind "j" "Down" { Resize "Increase Down"; }
bind "k" "Up" { Resize "Increase Up"; }
bind "l" "Right" { Resize "Increase Right"; }
bind "H" { Resize "Decrease Left"; }
bind "J" { Resize "Decrease Down"; }
bind "K" { Resize "Decrease Up"; }
bind "L" { Resize "Decrease Right"; }
bind "=" "+" { Resize "Increase"; }
bind "-" { Resize "Decrease"; }
}
pane {
bind "Ctrl p" { SwitchToMode "Normal"; }
bind "h" "Left" { MoveFocus "Left"; }
bind "l" "Right" { MoveFocus "Right"; }
bind "j" "Down" { MoveFocus "Down"; }
bind "k" "Up" { MoveFocus "Up"; }
bind "p" { SwitchFocus; }
bind "n" { NewPane; SwitchToMode "Normal"; }
bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
bind "s" { NewPane "stacked"; SwitchToMode "Normal"; }
bind "x" { CloseFocus; SwitchToMode "Normal"; }
bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
bind "i" { TogglePanePinned; SwitchToMode "Normal"; }
}
move {
bind "Ctrl h" { SwitchToMode "Normal"; }
bind "n" "Tab" { MovePane; }
bind "p" { MovePaneBackwards; }
bind "h" "Left" { MovePane "Left"; }
bind "j" "Down" { MovePane "Down"; }
bind "k" "Up" { MovePane "Up"; }
bind "l" "Right" { MovePane "Right"; }
}
tab {
bind "Ctrl t" { SwitchToMode "Normal"; }
bind "r" {
MessagePlugin "smart-tabs" {
name "set_focused_to_manual"
}
SwitchToMode "RenameTab"
TabNameInput 0
}
bind "h" "Left" "Up" "k" { GoToPreviousTab; }
bind "l" "Right" "Down" "j" { GoToNextTab; }
bind "n" { NewTab; SwitchToMode "Normal"; }
bind "x" { CloseTab; SwitchToMode "Normal"; }
bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
bind "b" { BreakPane; SwitchToMode "Normal"; }
bind "]" { BreakPaneRight; SwitchToMode "Normal"; }
bind "[" { BreakPaneLeft; SwitchToMode "Normal"; }
bind "1" { GoToTab 1; SwitchToMode "Normal"; }
bind "2" { GoToTab 2; SwitchToMode "Normal"; }
bind "3" { GoToTab 3; SwitchToMode "Normal"; }
bind "4" { GoToTab 4; SwitchToMode "Normal"; }
bind "5" { GoToTab 5; SwitchToMode "Normal"; }
bind "6" { GoToTab 6; SwitchToMode "Normal"; }
bind "7" { GoToTab 7; SwitchToMode "Normal"; }
bind "8" { GoToTab 8; SwitchToMode "Normal"; }
bind "9" { GoToTab 9; SwitchToMode "Normal"; }
bind "Tab" { ToggleTab; }
}
scroll {
bind "Ctrl s" { SwitchToMode "Normal"; }
bind "e" { EditScrollback; SwitchToMode "Normal"; }
bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
bind "j" "Down" { ScrollDown; }
bind "k" "Up" { ScrollUp; }
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
bind "d" { HalfPageScrollDown; }
bind "u" { HalfPageScrollUp; }
// uncomment this and adjust key if using copy_on_select=false
// bind "Alt c" { Copy; }
}
search {
bind "Ctrl s" { SwitchToMode "Normal"; }
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
bind "j" "Down" { ScrollDown; }
bind "k" "Up" { ScrollUp; }
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
bind "d" { HalfPageScrollDown; }
bind "u" { HalfPageScrollUp; }
bind "n" { Search "down"; }
bind "p" { Search "up"; }
bind "c" { SearchToggleOption "CaseSensitivity"; }
bind "w" { SearchToggleOption "Wrap"; }
bind "o" { SearchToggleOption "WholeWord"; }
}
entersearch {
bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; }
bind "Enter" { SwitchToMode "Search"; }
}
renametab {
bind "Ctrl c" { SwitchToMode "Normal"; }
bind "Esc" {
UndoRenameTab
SwitchToMode "tab"
MessagePlugin "smart-tabs" {
name "set_focused_to_managed"
}
}
}
renamepane {
bind "Ctrl c" { SwitchToMode "Normal"; }
bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
}
session {
bind "Ctrl o" { SwitchToMode "Normal"; }
bind "Ctrl s" { SwitchToMode "Scroll"; }
bind "d" { Detach; }
}
}
plugins {
tab-bar location="zellij:tab-bar"
status-bar location="zellij:status-bar"
strider location="zellij:strider"
compact-bar location="zellij:compact-bar"
session-manager location="zellij:session-manager"
welcome-screen location="zellij:session-manager" {
welcome_screen true
}
filepicker location="zellij:strider" {
cwd "/"
}
smart-tabs location="file:~/.config/zellij/plugins/zellij-smart-tabs.wasm" {
format {{ `"{% if short_git_root %}{{ short_git_root }}{% else %}{{ short_dir }}{% endif %}{% if program %} \u{eab6} {{ program }}{% endif %}"` }}
poll_interval "5.0"
debounce "0.2"
}
}
load_plugins {
smart-tabs
}
// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
// eg. when terminal window with an active zellij session is closed
// Options:
// - detach (Default)
// - quit
//
// on_force_close "quit"
// Send a request for a simplified ui (without arrow fonts) to plugins
// Options:
// - true
// - false (Default)
//
simplified_ui true
// Choose the path to the default shell that zellij will use for opening new panes
// Default: $SHELL
//
// default_shell "fish"
// Choose the path to override cwd that zellij will use for opening new panes
//
default_cwd "~"
// Toggle between having pane frames around the panes
// Options:
// - true (default)
// - false
//
// pane_frames true
// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible
// Options:
// - true (default)
// - false
//
// auto_layout true
// Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected
// Options:
// - true (default)
// - false
//
// session_serialization false
// Whether pane viewports are serialized along with the session, default is false
// Options:
// - true
// - false (default)
// serialize_pane_viewport true
// Scrollback lines to serialize along with the pane viewport when serializing sessions, 0
// defaults to the scrollback size. If this number is higher than the scrollback size, it will
// also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true.
//
// scrollback_lines_to_serialize 10000
// Define color themes for Zellij
// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes
// Once these themes are defined, one of them should to be selected in the "theme" section of this file
//
// themes {
// dracula {
// fg 248 248 242
// bg 40 42 54
// red 255 85 85
// green 80 250 123
// yellow 241 250 140
// blue 98 114 164
// magenta 255 121 198
// orange 255 184 108
// cyan 139 233 253
// black 0 0 0
// white 255 255 255
// }
// }
// Choose the theme that is specified in the themes section.
// Default: default
//
theme "default"
// The name of the default layout to load on startup
// Default: "default"
//
// default_layout "compact"
// Choose the mode that zellij uses when starting up.
// Default: normal
//
// default_mode "locked"
// Toggle enabling the mouse mode.
// On certain configurations, or terminals this could
// potentially interfere with copying text.
// Options:
// - true (default)
// - false
//
// mouse_mode false
// Configure the scroll back buffer size
// This is the number of lines zellij stores for each pane in the scroll back
// buffer. Excess number of lines are discarded in a FIFO fashion.
// Valid values: positive integers
// Default value: 10000
//
// scroll_buffer_size 10000
// Provide a command to execute when copying text. The text will be piped to
// the stdin of the program to perform the copy. This can be used with
// terminal emulators which do not support the OSC 52 ANSI control sequence
// that will be used by default if this option is not set.
// Examples:
//
// copy_command "xclip -selection clipboard" // x11
// copy_command "wl-copy" // wayland
// copy_command "pbcopy" // osx
{{ if and (eq .chezmoi.os "linux") (eq (env "XDG_SESSION_TYPE") "wayland") -}}
copy_command "wl-copy"
{{- end }}
// Choose the destination for copied text
// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard.
// Does not apply when using copy_command.
// Options:
// - system (default)
// - primary
//
// copy_clipboard "primary"
// Enable or disable automatic copy (and clear) of selection when releasing mouse
// Default: true
//
copy_on_select true
// Path to the default editor to use to edit pane scrollbuffer
// Default: $EDITOR or $VISUAL
//
// scrollback_editor "/usr/bin/vim"
// When attaching to an existing session with other users,
// should the session be mirrored (true)
// or should each user have their own cursor (false)
// Default: false
//
// mirror_session true
// The folder in which Zellij will look for layouts
//
// layout_dir "/path/to/my/layout_dir"
// The folder in which Zellij will look for themes
//
// theme_dir "/path/to/my/theme_dir"
// Enable or disable the rendering of styled and colored underlines (undercurl).
// May need to be disabled for certain unsupported terminals
// Default: true
//
// styled_underlines false
// Enable or disable writing of session metadata to disk (if disabled, other sessions might not know
// metadata info on this session)
// Default: false
//
// disable_session_metadata true
// The maximum number of lines in the scrollback buffer.
// When exceeded, older lines are discarded.
// Default value: 10000
//
max_scroll_back_lines 10000
// The mode to use for scrolling.
// Options:
// - "default": Use default scrolling behavior
// - "scroll_to_bottom_on_focus": Scroll to bottom when pane is focused
//
// scroll_mode "default"
// When a pane is closed, should the focus move to the next pane?
// Options:
// - true (default): Move focus to next pane
// - false: Don't move focus
//
// focus_nearest_pane_on_close true
// When a pane is closed, should the remaining panes be resized to fill the space?
// Options:
// - true (default): Resize remaining panes
// - false: Don't resize
//
// fill_pane_on_close true
// Should zellij try to detect if it's running inside another terminal multiplexer?
// Options:
// - true (default): Try to detect
// - false: Don't try to detect
//
// detect_nested_multiplexer true
// Should zellij try to detect if it's running inside a WSL environment?
// Options:
// - true: Try to detect WSL
// - false (default): Don't try to detect
//
{{ if eq .chezmoi.os "linux" -}}
detect_wsl true
{{- end }}
// The command to run when zellij detects it's running inside WSL
// This can be used to configure clipboard access in WSL
// Example:
// wsl_command "clipboard.exe"
//
// wsl_command ""
// Should zellij try to detect if it's running inside a container?
// Options:
// - true: Try to detect
// - false (default): Don't try to detect
//
// detect_container false
// Set the working directory for new tabs
// Default: ~
//
// tab_default_cwd "~"
// Set the working directory for new panes
// Default: ~
//
// pane_default_cwd "~"
// Should zellij preserve the working directory of new tabs?
// Options:
// - true (default): Preserve working directory
// - false: Don't preserve working directory
//
// preserve_tab_wd true
// Should zellij preserve the working directory of new panes?
// Options:
// - true (default): Preserve working directory
// - false: Don't preserve working directory
//
// preserve_pane_wd true
web_client {
font "monospace"
}
layout {
cwd "~"
default_tab_template {
children
pane size=1 borderless=true {
plugin location="zellij:compact-bar"
}
}
tab name="labs" focus=true hide_floating_panes=true {
pane stacked=true {
pane command="nvim" cwd="brain" {
start_suspended true
}
pane command="pix" cwd="brain" focus=true expanded=true {
start_suspended true
}
pane cwd="clones/labs" {
}
}
}
}
layout {
cwd "~"
default_tab_template {
children
pane size=1 borderless=true {
plugin location="zellij:compact-bar"
}
}
tab name="tunnel" focus=true hide_floating_panes=true {
pane stacked=true {
pane command="infisical" cwd="clones/labs/proxy" focus=true expanded=true {
args "run" "--silent" "--" "frpc" "-c" "frpc-primary.toml"
start_suspended true
}
pane command="infisical" cwd="clones/labs/proxy" {
args "run" "--silent" "--" "syncthing" "serve" "--no-browser"
start_suspended true
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment