nixos-config/home-manager/modules/zellij/default.nix

583 lines
17 KiB
Nix
Raw Normal View History

{ config, lib, ... }:
2022-10-14 21:49:57 +02:00
with lib;
let
cfg = config.eboskma.programs.zellij;
in
{
2022-11-17 14:06:39 +01:00
options.eboskma.programs.zellij = {
enable = mkEnableOption "zellij";
copyCommand = mkOption {
description = "Command used to copy a selection";
type = types.str;
example = literalExpression ''"''${pkgs.wl-clipboard}/bin/wl-copy"'';
};
};
2022-10-14 21:49:57 +02:00
config = mkIf cfg.enable {
2022-10-14 21:49:57 +02:00
programs.zellij = {
enable = true;
settings = {
theme = "dracula";
2022-11-17 14:06:39 +01:00
copy_command = cfg.copyCommand;
2022-10-14 21:49:57 +02:00
scrollback_editor = "${config.eboskma.programs.emacs.package}/bin/emacsclient";
2022-10-25 09:40:32 +02:00
pane_frames = false;
2022-10-14 21:49:57 +02:00
2022-10-30 21:06:40 +01:00
themes = {
dracula = {
fg = [ 248 248 242 ];
bg = [ 40 42 54 ];
black = [ 0 0 0 ];
red = [ 255 85 85 ];
green = [ 80 250 123 ];
yellow = [ 241 250 140 ];
blue = [ 98 114 164 ];
magenta = [ 255 121 198 ];
cyan = [ 139 233 253 ];
white = [ 255 255 255 ];
orange = [ 255 184 108 ];
};
};
2022-10-14 21:49:57 +02:00
keybinds = {
normal = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
{ Ctrl = "n"; }
{ Ctrl = "b"; }
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ SwitchToMode = "Resize"; }];
2022-10-25 09:40:32 +02:00
key = [{ Ctrl = "m"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
key = [{ Alt = "i"; } { Alt = "Right"; }];
}
{
action = [{ MoveFocus = "Down"; }];
key = [{ Alt = "n"; } { Alt = "Down"; }];
}
{
action = [{ MoveFocus = "Up"; }];
key = [{ Alt = "e"; } { Alt = "Up"; }];
}
{
2022-10-25 09:40:32 +02:00
action = [{ NewPane = null; }];
key = [{ Alt = "c"; }];
2022-10-14 21:49:57 +02:00
}
];
resize = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Char = "l"; }
{ Char = "j"; }
{ Char = "k"; }
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
2022-10-30 21:06:40 +01:00
{ Ctrl = "b"; }
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ Resize = "Left"; }];
key = [{ Char = "h"; } "Left"];
}
{
action = [{ Resize = "Right"; }];
key = [{ Char = "i"; } "Right"];
}
{
2022-10-25 09:40:32 +02:00
action = [{ Resize = "Down"; }];
key = [{ Char = "n"; } "Down"];
2022-10-14 21:49:57 +02:00
}
{
2022-10-25 09:40:32 +02:00
action = [{ Resize = "Up"; }];
key = [{ Char = "e"; } "Up"];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
key = [{ Alt = "i"; } { Alt = "Right"; }];
}
{
action = [{ MoveFocus = "Down"; }];
key = [{ Alt = "n"; } { Alt = "Down"; }];
}
{
action = [{ MoveFocus = "Up"; }];
key = [{ Alt = "e"; } { Alt = "Up"; }];
}
];
pane = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Char = "l"; }
{ Char = "j"; }
{ Char = "k"; }
{ Char = "n"; }
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
{ Char = "f"; }
{ Ctrl = "n"; }
2022-10-30 21:06:40 +01:00
{ Ctrl = "b"; }
2022-10-25 09:40:32 +02:00
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ SwitchToMode = "Resize"; }];
2022-10-25 09:40:32 +02:00
key = [{ Ctrl = "m"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Left"; }];
key = [{ Char = "h"; } "Left"];
}
{
action = [{ MoveFocus = "Right"; }];
key = [{ Char = "i"; } "Right"];
}
{
action = [{ MoveFocus = "Down"; }];
key = [{ Char = "n"; } "Down"];
}
{
action = [{ MoveFocus = "Up"; }];
key = [{ Char = "e"; } "Up"];
}
{
action = [{ NewPane = null; } { SwitchToMode = "Normal"; }];
key = [{ Char = "c"; }];
}
{
action = [ "TogglePaneFrames" { SwitchToMode = "Normal"; } ];
key = [{ Char = "z"; }];
}
{
action = [ "ToggleFloatingPanes" { SwitchToMode = "Normal"; } ];
key = [{ Char = "w"; }];
}
{
action = [ "TogglePaneEmbedOrFloating" { SwitchToMode = "Normal"; } ];
2022-10-25 09:40:32 +02:00
key = [{ Char = "f"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ NewPane = null; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "i"; } { Alt = "Right"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Down"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "n"; } { Alt = "Down"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Up"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "e"; } { Alt = "Up"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ SwitchToMode = "RenamePane"; } { PaneNameInput = [ 0 ]; }];
2022-10-25 09:40:32 +02:00
key = [{ Char = "m"; }];
2022-10-14 21:49:57 +02:00
}
];
move = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Char = "l"; }
{ Char = "j"; }
{ Char = "k"; }
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
{ Char = "n"; }
{ Ctrl = "n"; }
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ SwitchToMode = "Resize"; }];
2022-10-25 09:40:32 +02:00
key = [{ Ctrl = "m"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MovePane = null; }];
2022-10-25 09:40:32 +02:00
key = [{ Char = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MovePane = "Left"; }];
key = [{ Char = "h"; } "Left"];
}
{
2022-10-25 09:40:32 +02:00
action = [{ MovePane = "Right"; }];
key = [{ Char = "i"; } "Right"];
2022-10-14 21:49:57 +02:00
}
{
2022-10-25 09:40:32 +02:00
action = [{ MovePane = "Down"; }];
key = [{ Char = "n"; } "Down"];
2022-10-14 21:49:57 +02:00
}
{
2022-10-25 09:40:32 +02:00
action = [{ MovePane = "Up"; }];
key = [{ Char = "e"; } "Up"];
2022-10-14 21:49:57 +02:00
}
{
action = [{ NewPane = null; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "i"; } { Alt = "Right"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Down"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "n"; } { Alt = "Down"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Up"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "e"; } { Alt = "Up"; }];
2022-10-14 21:49:57 +02:00
}
];
tab = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Char = "l"; }
{ Char = "j"; }
{ Char = "k"; }
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
{ Char = "n"; }
{ Ctrl = "n"; }
2022-10-30 21:06:40 +01:00
{ Ctrl = "b"; }
2022-10-25 09:40:32 +02:00
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ SwitchToMode = "Resize"; }];
2022-10-25 09:40:32 +02:00
key = [{ Ctrl = "m"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [ "GoToPreviousTab" ];
2022-10-25 09:40:32 +02:00
key = [{ Char = "h"; } "Left" "Up" { Char = "e"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [ "GoToNextTab" ];
2022-10-25 09:40:32 +02:00
key = [{ Char = "i"; } "Right" "Down" { Char = "n"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ NewTab = null; } { SwitchToMode = "Normal"; }];
2022-10-25 09:40:32 +02:00
key = [{ Char = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ NewPane = null; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "i"; } { Alt = "Right"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Down"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "n"; } { Alt = "Down"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Up"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "e"; } { Alt = "Up"; }];
2022-10-14 21:49:57 +02:00
}
];
scroll = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Char = "l"; }
{ Char = "j"; }
{ Char = "k"; }
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
{ Ctrl = "n"; }
2022-10-30 21:06:40 +01:00
{ Ctrl = "b"; }
2022-10-25 09:40:32 +02:00
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ SwitchToMode = "Resize"; }];
2022-10-25 09:40:32 +02:00
key = [{ Ctrl = "m"; }];
2022-10-14 21:49:57 +02:00
}
{
2022-10-25 09:40:32 +02:00
action = [ "EditScrollback" { SwitchToMode = "Normal"; } ];
key = [{ Char = "a"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [ "ScrollDown" ];
2022-10-25 09:40:32 +02:00
key = [{ Char = "n"; } "Down"];
2022-10-14 21:49:57 +02:00
}
{
action = [ "ScrollUp" ];
2022-10-25 09:40:32 +02:00
key = [{ Char = "e"; } "Up"];
2022-10-14 21:49:57 +02:00
}
{
action = [ "PageScrollDown" ];
2022-10-25 09:40:32 +02:00
key = [{ Ctrl = "f"; } "PageDown" "Right" { Char = "i"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [ "PageScrollUp" ];
key = [{ Ctrl = "b"; } "PageUp" "Left" { Char = "h"; }];
}
{
action = [{ NewPane = null; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "i"; } { Alt = "Right"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Down"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "n"; } { Alt = "Down"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Up"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "e"; } { Alt = "Up"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ SwitchToMode = "EnterSearch"; } { SearchInput = [ 0 ]; }];
key = [{ Char = "s"; }];
}
];
entersearch = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Char = "l"; }
{ Char = "j"; }
{ Char = "k"; }
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
{ Char = "e"; }
{ Ctrl = "c"; }
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ SearchInput = [ 27 ]; } { SwitchToMode = "Scroll"; }];
2022-10-25 09:40:32 +02:00
key = [{ Ctrl = "s"; } "Esc"];
2022-10-14 21:49:57 +02:00
}
{
action = [{ NewPane = null; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "i"; } { Alt = "Right"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Down"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "n"; } { Alt = "Down"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Up"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "e"; } { Alt = "Up"; }];
2022-10-14 21:49:57 +02:00
}
];
search = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Char = "l"; }
{ Char = "j"; }
{ Char = "k"; }
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
{ Ctrl = "c"; }
{ Ctrl = "n"; }
{ Char = "p"; }
2022-10-30 21:06:40 +01:00
{ Ctrl = "b"; }
2022-10-25 09:40:32 +02:00
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ SwitchToMode = "Resize"; }];
2022-10-25 09:40:32 +02:00
key = [{ Ctrl = "m"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [ "ScrollDown" ];
2022-10-25 09:40:32 +02:00
key = [{ Char = "n"; } "Down"];
2022-10-14 21:49:57 +02:00
}
{
action = [ "ScrollUp" ];
2022-10-25 09:40:32 +02:00
key = [{ Char = "e"; } "Up"];
2022-10-14 21:49:57 +02:00
}
{
action = [ "PageScrollDown" ];
2022-10-25 09:40:32 +02:00
key = [{ Ctrl = "f"; } "PageDown" "Right" { Char = "i"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [ "PageScrollUp" ];
key = [{ Ctrl = "b"; } "PageUp" "Left" { Char = "h"; }];
}
{
action = [{ NewPane = null; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "i"; } { Alt = "Right"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Down"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "n"; } { Alt = "Down"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Up"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "e"; } { Alt = "Up"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ Search = "Down"; }];
2022-10-25 09:40:32 +02:00
key = [{ Char = "k"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ Search = "Up"; }];
2022-10-25 09:40:32 +02:00
key = [{ Char = "j"; }];
2022-10-14 21:49:57 +02:00
}
];
renametab = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ NewPane = null; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "i"; } { Alt = "Right"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Down"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "n"; } { Alt = "Down"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Up"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "e"; } { Alt = "Up"; }];
2022-10-14 21:49:57 +02:00
}
];
renamepane = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ NewPane = null; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "i"; } { Alt = "Right"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Down"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "n"; } { Alt = "Down"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Up"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "e"; } { Alt = "Up"; }];
2022-10-14 21:49:57 +02:00
}
];
session = [
{
2022-10-25 09:40:32 +02:00
unbind = [
{ Alt = "l"; }
{ Alt = "j"; }
{ Alt = "k"; }
{ Ctrl = "n"; }
2022-10-30 21:06:40 +01:00
{ Ctrl = "b"; }
2022-10-25 09:40:32 +02:00
];
2022-10-14 21:49:57 +02:00
}
{
action = [{ SwitchToMode = "Resize"; }];
2022-10-25 09:40:32 +02:00
key = [{ Ctrl = "m"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ NewPane = null; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "c"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocusOrTab = "Left"; }];
key = [{ Alt = "h"; } { Alt = "Left"; }];
}
{
action = [{ MoveFocusOrTab = "Right"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "i"; } { Alt = "Right"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Down"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "n"; } { Alt = "Down"; }];
2022-10-14 21:49:57 +02:00
}
{
action = [{ MoveFocus = "Up"; }];
2022-10-25 09:40:32 +02:00
key = [{ Alt = "e"; } { Alt = "Up"; }];
2022-10-14 21:49:57 +02:00
}
];
tmux = [
{
2022-10-30 21:06:40 +01:00
unbind = true;
2022-10-14 21:49:57 +02:00
}
];
};
};
};
};
}