theme "rose-pine-moon";
on_force_close "detach"
pane_frames false
default_layout "compact"
scroll_buffer_size 20000
// copy_clipboard "primary" // primary or system, default is system
// These keybindings mostly override everything about the default keybindings in an attempt
// to mimic the best parts of the Doom Emacs / Spacemacs keybindings style.
//
// The keybindings are meant to be mnemonic as possible.
//
// I'm referring to "panes" as "windows".
// For most of these modes I'm thinking of them as mnemonic key namespaces that take you to
// an action. For example, to move one pane to the left: `prefix` -> `w` -> `h`
// where `prefix` is the keybinding to get from "locked" mode into "normal" mode
// `w` takes you from "normal" mode into "pane" mode, then `h` moves panes and terminates the action.
// Once in "pane" mode ther are some non-terminating actions available, and I'm thinking of those as
// "transient" states that allow you to do a bunch of repeated actions in a row before exciting with `Esc`.
// I was introduced to this concept in Spacemacs.
// That's the overall strategy with these keybindings. This strategy is super easy to remember for me, and
// does seem to reduce wrist strain (the dreaded RSI :scream:)
// it would be super cool to define custom modes, maybe i could make an attempt at that
// https://github.com/zellij-org/zellij/issues/248
keybinds {
normal clear-defaults=true {
bind "Esc" { SwitchToMode "locked"; } // TODO rm when shared or shared_except works
bind "Enter" { SwitchToMode "locked"; }
bind "r" { SwitchToMode "resize"; }
bind "w" { SwitchToMode "pane"; }
bind "t" { SwitchToMode "tab"; }
bind "Alt h" { MoveFocus "Left"; }
bind "Alt j" { MoveFocus "Down"; }
bind "Alt k" { MoveFocus "Up"; }
bind "Alt l" { MoveFocus "Right"; }
bind "H" { PageScrollUp; }
bind "J" { PageScrollDown; }
bind "G" { ScrollToBottom; }
bind "Alt n" { NewPane; }
bind "Alt d" { CloseFocus; }
bind "Alt f" { ToggleFocusFullscreen; }
bind "Alt t" { NewTab; }
bind "Alt [" { GoToPreviousTab; }
bind "Alt ]" { GoToNextTab; }
bind "Alt 1" { GoToTab 1; }
bind "Alt 2" { GoToTab 2; }
bind "Alt 3" { GoToTab 3; }
bind "Alt 4" { GoToTab 4; }
bind "Alt 5" { GoToTab 5; }
bind "Alt 6" { GoToTab 6; }
bind "Alt 7" { GoToTab 7; }
bind "Alt 9" { GoToTab 9; }
bind "Ctrl [" { PreviousSwapLayout; }
bind "Ctrl ]" { NextSwapLayout; }
}
pane clear-defaults=true {
bind "Esc" { SwitchToMode "locked"; } // TODO rm when shared or shared_except works
bind "Alt h" { MovePane "Left"; }
bind "Alt j" { MovePane "Down"; }
bind "Alt k" { MovePane "Up"; }
bind "Alt l" { MovePane "Right"; }
bind "h" { MoveFocus "Left"; SwitchToMode "locked"; }
bind "j" { MoveFocus "Down"; SwitchToMode "locked"; }
bind "k" { MoveFocus "Up"; SwitchToMode "locked"; }
bind "l" { MoveFocus "Right"; SwitchToMode "locked"; }
bind "n" { NewPane; SwitchToMode "locked"; }
bind "d" { CloseFocus; SwitchToMode "locked"; }
bind "f" { ToggleFocusFullscreen; SwitchToMode "locked"; }
bind "D" { NewPane "Down"; SwitchToMode "locked"; }
bind "R" { NewPane "Right"; SwitchToMode "locked"; }
bind "z" { TogglePaneFrames; SwitchToMode "locked"; }
// for pop and popping out a tiled window into a floating window
bind "p" { ToggleFloatingPanes; SwitchToMode "locked"; }
bind "P" { TogglePaneEmbedOrFloating; SwitchToMode "locked"; }
// bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
}
resize clear-defaults=true {
bind "Esc" { SwitchToMode "locked"; } // TODO rm when shared or shared_except works
bind "h" { Resize "Left"; }
bind "j" { Resize "Down"; }
bind "k" { Resize "Up"; }
bind "l" { Resize "Right"; }
}
tab clear-defaults=true {
bind "Esc" { SwitchToMode "locked"; } // TODO rm when shared or shared_except works
bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
bind "h" "k" "[" { GoToPreviousTab; }
bind "l" "j" "]" { GoToNextTab; }
bind "n" { NewTab; SwitchToMode "locked"; }
bind "d" { CloseTab; SwitchToMode "locked"; }
// bind "s" { ToggleActiveSyncTab; SwitchToMode "locked"; }
bind "1" { GoToTab 1; SwitchToMode "locked"; }
bind "2" { GoToTab 2; SwitchToMode "locked"; }
bind "3" { GoToTab 3; SwitchToMode "locked"; }
bind "4" { GoToTab 4; SwitchToMode "locked"; }
bind "5" { GoToTab 5; SwitchToMode "locked"; }
bind "6" { GoToTab 6; SwitchToMode "locked"; }
bind "7" { GoToTab 7; SwitchToMode "locked"; }
bind "8" { GoToTab 8; SwitchToMode "locked"; }
bind "9" { GoToTab 9; SwitchToMode "locked"; }
bind "Tab" { ToggleTab; }
}
// locked is the mode meant to be used most of the time, e.g. when actually doing work
// TODO make my default layout start in locked mode
locked clear-defaults=true {
bind "Alt n" { SwitchToMode "normal"; }
bind "Alt q" { Detach; }
bind "Alt Q" { Quit; }
}
// FIXME shared_except does not seem to work, I'm not sure if I'm doing something wrong.
// shared_except "locked" {
// bind "Esc" { SwitchToMode "locked"; }
// }
}