/ .config / zellij / config.kdl
config.kdl
  1  // If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
  2  keybinds clear-defaults=true {
  3      normal {
  4          // uncomment this and adjust key if using copy_on_select=false
  5          // bind "Alt c" { Copy; }
  6      }
  7      locked {
  8          bind "Ctrl g" { SwitchToMode "Normal"; }
  9      }
 10      resize {
 11          bind "Ctrl n" { SwitchToMode "Normal"; }
 12          bind "h" "Left" { Resize "Increase Left"; }
 13          bind "j" "Down" { Resize "Increase Down"; }
 14          bind "k" "Up" { Resize "Increase Up"; }
 15          bind "l" "Right" { Resize "Increase Right"; }
 16          bind "H" { Resize "Decrease Left"; }
 17          bind "J" { Resize "Decrease Down"; }
 18          bind "K" { Resize "Decrease Up"; }
 19          bind "L" { Resize "Decrease Right"; }
 20          bind "=" "+" { Resize "Increase"; }
 21          bind "-" { Resize "Decrease"; }
 22      }
 23      pane {
 24          bind "Ctrl p" { SwitchToMode "Normal"; }
 25          bind "h" "Left" { MoveFocus "Left"; }
 26          bind "l" "Right" { MoveFocus "Right"; }
 27          bind "j" "Down" { MoveFocus "Down"; }
 28          bind "k" "Up" { MoveFocus "Up"; }
 29          bind "p" { SwitchFocus; }
 30          bind "n" { NewPane; SwitchToMode "Normal"; }
 31          bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
 32          bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
 33          bind "x" { CloseFocus; SwitchToMode "Normal"; }
 34          bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
 35          bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
 36          bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
 37          bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
 38          bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
 39      }
 40      move {
 41          bind "Ctrl h" { SwitchToMode "Normal"; }
 42          bind "n" "Tab" { MovePane; }
 43          bind "p" { MovePaneBackwards; }
 44          bind "h" "Left" { MovePane "Left"; }
 45          bind "j" "Down" { MovePane "Down"; }
 46          bind "k" "Up" { MovePane "Up"; }
 47          bind "l" "Right" { MovePane "Right"; }
 48      }
 49      tab {
 50          bind "Ctrl t" { SwitchToMode "Normal"; }
 51          bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
 52          bind "h" "Left" "Up" "k" { GoToPreviousTab; }
 53          bind "l" "Right" "Down" "j" { GoToNextTab; }
 54          bind "n" { NewTab; SwitchToMode "Normal"; }
 55          bind "x" { CloseTab; SwitchToMode "Normal"; }
 56          bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
 57          bind "b" { BreakPane; SwitchToMode "Normal"; }
 58          bind "]" { BreakPaneRight; SwitchToMode "Normal"; }
 59          bind "[" { BreakPaneLeft; SwitchToMode "Normal"; }
 60          bind "1" { GoToTab 1; SwitchToMode "Normal"; }
 61          bind "2" { GoToTab 2; SwitchToMode "Normal"; }
 62          bind "3" { GoToTab 3; SwitchToMode "Normal"; }
 63          bind "4" { GoToTab 4; SwitchToMode "Normal"; }
 64          bind "5" { GoToTab 5; SwitchToMode "Normal"; }
 65          bind "6" { GoToTab 6; SwitchToMode "Normal"; }
 66          bind "7" { GoToTab 7; SwitchToMode "Normal"; }
 67          bind "8" { GoToTab 8; SwitchToMode "Normal"; }
 68          bind "9" { GoToTab 9; SwitchToMode "Normal"; }
 69          bind "Tab" { ToggleTab; }
 70      }
 71      scroll {
 72          bind "Ctrl s" { SwitchToMode "Normal"; }
 73          bind "e" { EditScrollback; SwitchToMode "Normal"; }
 74          bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
 75          bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
 76          bind "j" "Down" { ScrollDown; }
 77          bind "k" "Up" { ScrollUp; }
 78          bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
 79          bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
 80          bind "d" { HalfPageScrollDown; }
 81          bind "u" { HalfPageScrollUp; }
 82          // uncomment this and adjust key if using copy_on_select=false
 83          // bind "Alt c" { Copy; }
 84      }
 85      search {
 86          bind "Ctrl s" { SwitchToMode "Normal"; }
 87          bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
 88          bind "j" "Down" { ScrollDown; }
 89          bind "k" "Up" { ScrollUp; }
 90          bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
 91          bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
 92          bind "d" { HalfPageScrollDown; }
 93          bind "u" { HalfPageScrollUp; }
 94          bind "n" { Search "down"; }
 95          bind "p" { Search "up"; }
 96          bind "c" { SearchToggleOption "CaseSensitivity"; }
 97          bind "w" { SearchToggleOption "Wrap"; }
 98          bind "o" { SearchToggleOption "WholeWord"; }
 99      }
100      entersearch {
101          bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; }
102          bind "Enter" { SwitchToMode "Search"; }
103      }
104      renametab {
105          bind "Ctrl c" { SwitchToMode "Normal"; }
106          bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; }
107      }
108      renamepane {
109          bind "Ctrl c" { SwitchToMode "Normal"; }
110          bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
111      }
112      session {
113          bind "Ctrl o" { SwitchToMode "Normal"; }
114          bind "Ctrl s" { SwitchToMode "Scroll"; }
115          bind "d" { Detach; }
116          bind "w" {
117              LaunchOrFocusPlugin "session-manager" {
118                  floating true
119                  move_to_focused_tab true
120              };
121              SwitchToMode "Normal"
122          }
123      }
124      tmux {
125          bind "[" { SwitchToMode "Scroll"; }
126          bind "Ctrl b" { Write 2; SwitchToMode "Normal"; }
127          bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
128          bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
129          bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
130          bind "c" { NewTab; SwitchToMode "Normal"; }
131          bind "," { SwitchToMode "RenameTab"; }
132          bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
133          bind "n" { GoToNextTab; SwitchToMode "Normal"; }
134          bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
135          bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
136          bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
137          bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
138          bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; }
139          bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; }
140          bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; }
141          bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; }
142          bind "o" { FocusNextPane; }
143          bind "d" { Detach; }
144          bind "Space" { NextSwapLayout; }
145          bind "x" { CloseFocus; SwitchToMode "Normal"; }
146      }
147      shared_except "locked" {
148          bind "Ctrl g" { SwitchToMode "Locked"; }
149  //        bind "Ctrl q" { Quit; }
150          bind "Alt n" { NewPane; }
151          bind "Alt i" { MoveTab "Left"; }
152          bind "Alt o" { MoveTab "Right"; }
153          bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
154          bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
155          bind "Alt j" "Alt Down" { MoveFocus "Down"; }
156          bind "Alt k" "Alt Up" { MoveFocus "Up"; }
157          bind "Alt =" "Alt +" { Resize "Increase"; }
158          bind "Alt -" { Resize "Decrease"; }
159          bind "Alt [" { PreviousSwapLayout; }
160          bind "Alt ]" { NextSwapLayout; }
161      }
162      shared_except "normal" "locked" {
163          bind "Enter" "Esc" { SwitchToMode "Normal"; }
164      }
165      shared_except "pane" "locked" {
166          bind "Ctrl p" { SwitchToMode "Pane"; }
167      }
168      shared_except "resize" "locked" {
169          bind "Ctrl n" { SwitchToMode "Resize"; }
170      }
171      shared_except "scroll" "locked" {
172          bind "Ctrl s" { SwitchToMode "Scroll"; }
173      }
174      shared_except "session" "locked" {
175          bind "Ctrl o" { SwitchToMode "Session"; }
176      }
177      shared_except "tab" "locked" {
178          bind "Ctrl t" { SwitchToMode "Tab"; }
179      }
180      shared_except "move" "locked" {
181          bind "Ctrl h" { SwitchToMode "Move"; }
182      }
183      shared_except "tmux" "locked" {
184          bind "Ctrl b" { SwitchToMode "Tmux"; }
185      }
186  }
187  
188  plugins {
189      tab-bar location="zellij:tab-bar"
190      status-bar location="zellij:status-bar"
191      strider location="zellij:strider"
192      compact-bar location="zellij:compact-bar"
193      session-manager location="zellij:session-manager"
194      welcome-screen location="zellij:session-manager" {
195          welcome_screen true
196      }
197      filepicker location="zellij:strider" {
198          cwd "/"
199      }
200  }
201  
202  // Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
203  // eg. when terminal window with an active zellij session is closed
204  // Options:
205  //   - detach (Default)
206  //   - quit
207  //
208  // on_force_close "quit"
209  
210  //  Send a request for a simplified ui (without arrow fonts) to plugins
211  //  Options:
212  //    - true
213  //    - false (Default)
214  //
215  // simplified_ui true
216  
217  // Choose the path to the default shell that zellij will use for opening new panes
218  // Default: $SHELL
219  //
220  // default_shell "fish"
221  
222  // Choose the path to override cwd that zellij will use for opening new panes
223  //
224  // default_cwd ""
225  
226  // Toggle between having pane frames around the panes
227  // Options:
228  //   - true (default)
229  //   - false
230  //
231  // pane_frames true
232  
233  // Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible
234  // Options:
235  //   - true (default)
236  //   - false
237  //
238  // auto_layout true
239  
240  // Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected
241  // Options:
242  //   - true (default)
243  //   - false
244  //
245  // session_serialization false
246  
247  // Whether pane viewports are serialized along with the session, default is false
248  // Options:
249  //   - true
250  //   - false (default)
251  // serialize_pane_viewport true
252  
253  // Scrollback lines to serialize along with the pane viewport when serializing sessions, 0
254  // defaults to the scrollback size. If this number is higher than the scrollback size, it will
255  // also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true.
256  //
257  // scrollback_lines_to_serialize 10000
258  
259  // Define color themes for Zellij
260  // For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes
261  // Once these themes are defined, one of them should to be selected in the "theme" section of this file
262  //
263  // themes {
264  //     dracula {
265  //         fg 248 248 242
266  //         bg 40 42 54
267  //         red 255 85 85
268  //         green 80 250 123
269  //         yellow 241 250 140
270  //         blue 98 114 164
271  //         magenta 255 121 198
272  //         orange 255 184 108
273  //         cyan 139 233 253
274  //         black 0 0 0
275  //         white 255 255 255
276  //     }
277  // }
278  
279  // Choose the theme that is specified in the themes section.
280  // Default: default
281  //
282  // theme "default"
283  
284  // The name of the default layout to load on startup
285  // Default: "default"
286  //
287  // default_layout "compact"
288  
289  // Choose the mode that zellij uses when starting up.
290  // Default: normal
291  //
292  // default_mode "locked"
293  
294  // Toggle enabling the mouse mode.
295  // On certain configurations, or terminals this could
296  // potentially interfere with copying text.
297  // Options:
298  //   - true (default)
299  //   - false
300  //
301  // mouse_mode false
302  
303  // Configure the scroll back buffer size
304  // This is the number of lines zellij stores for each pane in the scroll back
305  // buffer. Excess number of lines are discarded in a FIFO fashion.
306  // Valid values: positive integers
307  // Default value: 10000
308  //
309  // scroll_buffer_size 10000
310  
311  // Provide a command to execute when copying text. The text will be piped to
312  // the stdin of the program to perform the copy. This can be used with
313  // terminal emulators which do not support the OSC 52 ANSI control sequence
314  // that will be used by default if this option is not set.
315  // Examples:
316  //
317  // copy_command "xclip -selection clipboard" // x11
318  // copy_command "wl-copy"                    // wayland
319  // copy_command "pbcopy"                     // osx
320  
321  // Choose the destination for copied text
322  // Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard.
323  // Does not apply when using copy_command.
324  // Options:
325  //   - system (default)
326  //   - primary
327  //
328  // copy_clipboard "primary"
329  
330  // Enable or disable automatic copy (and clear) of selection when releasing mouse
331  // Default: true
332  //
333  // copy_on_select false
334  
335  // Path to the default editor to use to edit pane scrollbuffer
336  // Default: $EDITOR or $VISUAL
337  //
338  // scrollback_editor "/usr/bin/vim"
339  
340  // When attaching to an existing session with other users,
341  // should the session be mirrored (true)
342  // or should each user have their own cursor (false)
343  // Default: false
344  //
345  // mirror_session true
346  
347  // The folder in which Zellij will look for layouts
348  //
349  //layout_dir "/home/user/.config/zellij/layouts"
350  
351  // The folder in which Zellij will look for themes
352  //
353  // theme_dir "/path/to/my/theme_dir"
354  
355  // Enable or disable the rendering of styled and colored underlines (undercurl).
356  // May need to be disabled for certain unsupported terminals
357  // Default: true
358  //
359  // styled_underlines false
360  
361  // Enable or disable writing of session metadata to disk (if disabled, other sessions might not know
362  // metadata info on this session)
363  // Default: false
364  //
365  // disable_session_metadata true