Skip to content

Commit

Permalink
feat(zellij): init
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Apr 23, 2024
1 parent ecd11fd commit 7a42db9
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 0 deletions.
1 change: 1 addition & 0 deletions home/apps/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
./vscode.nix
./waybar.nix
./wezterm.nix
./zellij.nix
./zsh.nix
];
}
4 changes: 4 additions & 0 deletions home/apps/zellij.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
programs.zellij.enable = true;
xdg.configFile."zellij".source = ./zellij;
}
111 changes: 111 additions & 0 deletions home/apps/zellij/config.kdl
Original file line number Diff line number Diff line change
@@ -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

7 changes: 7 additions & 0 deletions home/apps/zellij/layouts/default.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
layout {
pane
pane size=1 borderless=true {
plugin location="compact-bar"
plugin location="status-bar"
}
}

0 comments on commit 7a42db9

Please sign in to comment.