diff --git a/home/apps/default.nix b/home/apps/default.nix index 79070b8..99498ab 100644 --- a/home/apps/default.nix +++ b/home/apps/default.nix @@ -19,6 +19,7 @@ ./vscode.nix ./waybar.nix ./wezterm.nix + ./zellij.nix ./zsh.nix ]; } diff --git a/home/apps/zellij.nix b/home/apps/zellij.nix new file mode 100644 index 0000000..32e8038 --- /dev/null +++ b/home/apps/zellij.nix @@ -0,0 +1,4 @@ +{ + programs.zellij.enable = true; + xdg.configFile."zellij".source = ./zellij; +} diff --git a/home/apps/zellij/config.kdl b/home/apps/zellij/config.kdl new file mode 100644 index 0000000..7664ab4 --- /dev/null +++ b/home/apps/zellij/config.kdl @@ -0,0 +1,111 @@ +keybinds clear-defaults=true { + tmux { + bind "Ctrl s" { Write 2; SwitchToMode "Normal"; } + bind "v" { SwitchToMode "Scroll"; } + bind "f" { SwitchToMode "EnterSearch"; } + bind "," { SwitchToMode "RenameTab"; } + bind "r" { SwitchToMode "Resize"; } + bind "s" { + LaunchOrFocusPlugin "session-manager" { + floating true + move_to_focused_tab true + }; + SwitchToMode "Normal" + } + + bind "c" { NewTab; SwitchToMode "Normal"; } + bind "-" { NewPane "Down"; SwitchToMode "Normal"; } + bind "\\" { NewPane "Right"; SwitchToMode "Normal"; } + bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; } + + bind "h" "Left" { MoveFocus "Left"; SwitchToMode "Normal"; } + bind "j" "Down" { MoveFocus "Down"; SwitchToMode "Normal"; } + bind "k" "Up" { MoveFocus "Up"; SwitchToMode "Normal"; } + bind "l" "Right" { MoveFocus "Right"; SwitchToMode "Normal"; } + + bind "d" { Detach; } + bind "x" { CloseFocus; 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"; } + } + + resize { + 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"; } + } + + scroll { + bind "Ctrl v" { 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; } + bind "Alt c" { Copy; } + } + + search { + 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"; } + } + + shared_except "normal" { + bind "Enter" "Esc" { SwitchToMode "Normal"; } + } + + shared_except "tmux" { + bind "Ctrl s" { SwitchToMode "Tmux"; } + } +} + +plugins { + status-bar location="zellij:status-bar" + compact-bar location="zellij:compact-bar" + session-manager location="zellij:session-manager" +} + +copy_on_select false + +theme "catppuccin-mocha" +pane_frames false + diff --git a/home/apps/zellij/layouts/default.kdl b/home/apps/zellij/layouts/default.kdl new file mode 100644 index 0000000..1d3f450 --- /dev/null +++ b/home/apps/zellij/layouts/default.kdl @@ -0,0 +1,7 @@ +layout { + pane + pane size=1 borderless=true { + plugin location="compact-bar" + plugin location="status-bar" + } +}