}
}];
home-manager.sharedModules = [{
enableBashIntegration = true;
programs.zellij = mkIf config.isDesktop (enabled {
};
layout {
pane
pane size=1 borderless=true {
plugin location="https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm" {
hide_frame_for_single_pane "true"
plumjam = ''
};
});
format_right "{datetime}"
format_space ""
datetime_format "%H:%M"
datetime_timezone "Europe/Warsaw"
}
}
}
'';
datetime "#[fg=${base0D},bold] {format}"
tab_normal "#[fg=${base05}] {index}:{name} "
tab_active "#[fg=${base0D},bold] {index}:{name} "
mode_normal "#[fg=${base00},bg=${base0B}] NOR "
mode_locked "#[fg=${base00},bg=${base08}] LOC "
mode_pane "#[fg=${base00},bg=${base0D}] PAN "
mode_tab "#[fg=${base00},bg=${base0E}] TAB "
mode_rename "#[fg=${base00},bg=${base0A}] REN "
mode_resize "#[fg=${base00},bg=${base0C}] RES "
mode_scroll "#[fg=${base00},bg=${base09}] SCR "
mode_session "#[fg=${base00},bg=${base0F}] SES "
format_center "{tabs}"
format_left "{mode} #[fg=gray,bold]{session}"
layouts = with config.theme.withHash; {
};
# Rename tab mode.
RenameTab._children = [
(key "Esc" { SwitchToMode._args = [ "locked" ]; })
(keyPlugin "Enter" [ { SwitchToMode._args = [ "locked" ]; }
])
];
load_plugins = [
"https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm"
"https://github.com/laperlej/zellij-sessionizer/releases/latest/download/zellij-sessionizer.wasm"
];
plugins.tab-bar.path = "tab-bar";
plugins.status-bar.path = "status-bar";
plugins.strider.path = "strider";
plugins.compact-bar.path = "compact-bar";
# Session mode.
session._children = [
(key "Esc" { SwitchToMode._args = [ "locked" ]; })
(key "d" { Detach = {}; })
(keyPlugin "w" [
{ LaunchOrFocusPlugin._args = [ "session-manager" "true" ]; }
])
];
{ SwitchToMode._args = [ "locked" ]; }
(key "Enter" { SwitchToMode._args = [ "locked" ]; })
# Scroll mode.
scroll._children = [
(key "Esc" { SwitchToMode._args = [ "locked" ]; })
(key "j" { ScrollDown = {}; })
(key "k" { ScrollUp = {}; })
(key "d" { HalfPageScrollDown = {}; })
(key "u" { HalfPageScrollUp = {}; })
(key "e" { EditScrollback = {}; })
];
(key "Enter" { SwitchToMode._args = [ "locked" ]; })
# Resize mode.
resize._children = [
(key "Esc" { SwitchToMode._args = [ "locked" ]; })
(key "h" { Resize._args = [ "Increase Left" ]; })
(key "j" { Resize._args = [ "Increase Down" ]; })
(key "k" { Resize._args = [ "Increase Up" ]; })
(key "l" { Resize._args = [ "Increase Right" ]; })
(key "H" { Resize._args = [ "Decrease Left" ]; })
(key "J" { Resize._args = [ "Decrease Down" ]; })
(key "K" { Resize._args = [ "Decrease Up" ]; })
(key "L" { Resize._args = [ "Decrease Right" ]; })
(key "+" { Resize._args = [ "Increase" ]; })
(key "-" { Resize._args = [ "Decrease" ]; })
];
(key "Enter" { SwitchToMode._args = [ "locked" ]; })
# Tab mode.
tab._children = [
(key "Esc" { SwitchToMode._args = [ "locked" ]; })
(key "h" { MoveTab._args = [ "Left" ]; })
(key "l" { MoveTab._args = [ "Right" ]; })
(key "n" { NewTab = {}; })
(key "x" { CloseTab = {}; })
(keyPlugin "r" [
{ SwitchToMode._args = [ "RenameTab" ]; }
{ TabNameInput._args = [ 0 ]; }
])
];
(key "Enter" { SwitchToMode._args = [ "locked" ]; })
# Pane mode.
pane._children = [
(key "Esc" { SwitchToMode._args = [ "locked" ];})
(key "h" { MoveFocus = [ "Left" ];})
(key "j" { MoveFocus = [ "Up" ];})
(key "k" { MoveFocus = [ "Down" ];})
(key "l" { MoveFocus = [ "Right" ];})
(key "n" { NewPane = {};})
(key "d" { NewPane._args = [ "Down" ];})
(key "r" { NewPane._args = [ "Right" ];})
(key "x" { CloseFocus = {};})
(key "f" { ToggleFocusFullscreen = {};})
(key "z" { TogglePaneFrames = {};})
(key "w" { ToggleFloatingPanes = {};})
];
(key "Enter" { SwitchToMode._args = [ "locked" ];})
# Normal mode.
normal._children = [
(key "Esc" { SwitchToMode._args = [ "locked" ]; })
(key "Ctrl w" { SwitchToMode._args = [ "pane" ]; })
(key "Ctrl t" { SwitchToMode._args = [ "tab" ]; })
(key "Ctrl r" { SwitchToMode._args = [ "resize" ]; })
(key "Ctrl s" { SwitchToMode._args = [ "scroll" ]; })
(key "Ctrl o" { SwitchToMode._args = [ "session" ]; })
(key "Ctrl h" { MoveFocus = [ "Left" ]; SwitchToMode._args = [ "locked" ]; })
(key "Ctrl j" { MoveFocus = [ "Down" ]; SwitchToMode._args = [ "locked" ]; })
(key "Ctrl k" { MoveFocus = [ "Up" ]; SwitchToMode._args = [ "locked" ]; })
(key "Ctrl l" { MoveFocus = [ "Right" ]; SwitchToMode._args = [ "locked" ]; })
(key "q" { GoToTab._args = [ 1 ];})
(key "w" { GoToTab._args = [ 2 ];})
(key "e" { GoToTab._args = [ 3 ];})
(key "r" { GoToTab._args = [ 4 ];})
(key "t" { GoToTab._args = [ 5 ];})
(key "y" { GoToTab._args = [ 6 ];})
(key "u" { GoToTab._args = [ 7 ];})
(key "i" { GoToTab._args = [ 8 ];})
(key "o" { GoToTab._args = [ 9 ];})
(key "H" { GoToPreviousTab = {}; })
(key "L" { GoToNextTab = {}; })
}; SwitchToMode._args = [ "locked" ];
}])
(keyPlugin "Ctrl n" [{
Run = {
_args = [ "nu" ];
close_on_exit = true;
floating = true;
x = "5%";
y = "5%";
width = "90%";
height = "90%";
}; SwitchToMode._args = [ "locked" ];
}])
(keyPlugin "Ctrl p" [{
LaunchOrFocusPlugin = {
move_to_focused_tab = true;
}; SwitchToMode._args = [ "locked" ];
}])
];
cwd = "/";
root_dirs = "/home/jam;/home/jam/projects;/home/jam/notes";
session_layout = "plumjam";
_args = [ "https://github.com/laperlej/zellij-sessionizer/releases/latest/download/zellij-sessionizer.wasm" ];
floating = true;
# (keyPlugin "Ctrl j" [{
# Run = {
# _args = [ "lazyjj" ];
# close_on_exit = true;
# floating = true;
# x = "5%";
# y = "5%";
# width = "90%";
# height = "90%";
# }; SwitchToMode._args = [ "locked" ];
# }])
(keyPlugin "g" [{
Run = {
_args = [ "nu" "--commands" "repo" ];
close_on_exit = true;
floating = true;
x = "1%";
y = "1%";
width = "1%";
height = "1%";
(key "Enter" { SwitchToMode._args = [ "locked" ]; })
# Locked mode.
locked._children = [
(key "Ctrl g" { SwitchToMode._args = [ "normal" ]; })
];
keybinds = {
_props.clear-defaults = true;
simplified_ui_default_plugin = "compact-bar";
ui.pane_frames.hide_session_name = false;
ui.pane_frames.rounded_corners = false;
env.EDITOR = config.environment.variables.EDITOR;
env.SHELL = "nu";
pane_viewport_serialization = true;
scrollback_lines_to_serialize = 5000;
default_mode = "locked";
copy_on_select = false;
copy_clipboard = "system";
mouse_mode = false;
scroll_buffer_size = 5000;
pane_frames = false;
simplified_ui = true;
show_startup_tips = false;
default_layout = "plumjam";
session_serialization = true;
auto_layout = true;
mirror_session = false;
on_force_close = "detach";
default_shell = "nu";
scrollback_editor = config.environment.variables.EDITOR;
settings = {
};
themes.custom = with config.theme.withRgb; {
bg = base00;
fg = base06;
red = base08;
green = base0B;
yellow = base0A;
blue = base0D;
magenta = base0E;
orange = base09;
cyan = base0C;
black = base01;
white = base05;
theme = if config.theme.color_scheme == "pywal" then "custom" else config.theme.zellij;
attachExistingSession = true;
exitShellOnExit = false;
inherit (lib) enabled mkIf;
# Simple Zellij key-binding helper.
key = k: action: {
bind = {
_args = [ k ];
} // action;
};
# Nested Zellij key-binding helper for plugins and similar.
keyPlugin = k: children: {
bind._args = [ k ];
bind._children = children;
};
in {
{ config, lib, ... }: let