Skip to content

Commit

Permalink
[zellij] setup
Browse files Browse the repository at this point in the history
  • Loading branch information
handlename committed Jun 18, 2024
1 parent e007b28 commit a964e0c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 21 deletions.
18 changes: 18 additions & 0 deletions codespaces/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,27 @@ EOH
rm -rf "$workdir"
}

function setup_zellij {
local zellij_version=0.40.1
local workdir=/tmp/zellij
mkdir -p "$workdir"

if ! which zellij >/dev/null; then
cd "$workdir"
curl -sL "https://github.com/zellij-org/zellij/releases/download/v${zellij_version}/zellij-x86_64-unknown-linux-musl.tar.gz" | tar zxf -
sudo install zellij /usr/local/bin/zellij
fi

mkdir -p ~/.config/zellij
cp "${script_dir}/../config/zellij/config.kdl" ~/.config/zellij/config.kdl

rm -rf "$workdir"
}

install_packages
setup_github
setup_fish
setup_actionlint
setup_awscli
setup_ecsta
setup_zellij
3 changes: 3 additions & 0 deletions config/alacritty/alacritty.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
shell = "/opt/homebrew/bin/fish"

[window]
option_as_alt = "Both"

[window.padding]
x = 8
y = 8
Expand Down
44 changes: 23 additions & 21 deletions config/zellij/config.kdl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
keybinds {
keybinds clear-defaults=true {
normal {
// uncomment this and adjust key if using copy_on_select=false
// bind "Alt c" { Copy; }
}
locked {
bind "Ctrl g" { SwitchToMode "Normal"; }
bind "Alt g" { SwitchToMode "Normal"; }
}
resize {
bind "Ctrl n" { SwitchToMode "Normal"; }
bind "Alt r" { SwitchToMode "Normal"; }
bind "h" "Left" { Resize "Increase Left"; }
bind "j" "Down" { Resize "Increase Down"; }
bind "k" "Up" { Resize "Increase Up"; }
Expand All @@ -21,7 +21,7 @@ keybinds {
bind "-" { Resize "Decrease"; }
}
pane {
bind "Ctrl p" { SwitchToMode "Normal"; }
bind "Alt p" { SwitchToMode "Normal"; }
bind "h" "Left" { MoveFocus "Left"; }
bind "l" "Right" { MoveFocus "Right"; }
bind "j" "Down" { MoveFocus "Down"; }
Expand All @@ -38,7 +38,7 @@ keybinds {
bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
}
move {
bind "Ctrl h" { SwitchToMode "Normal"; }
bind "Alt m" { SwitchToMode "Normal"; }
bind "n" "Tab" { MovePane; }
bind "p" { MovePaneBackwards; }
bind "h" "Left" { MovePane "Left"; }
Expand All @@ -47,7 +47,7 @@ keybinds {
bind "l" "Right" { MovePane "Right"; }
}
tab {
bind "Ctrl t" { SwitchToMode "Normal"; }
bind "Alt t" { SwitchToMode "Normal"; }
bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
bind "h" "Left" "Up" "k" { GoToPreviousTab; }
bind "l" "Right" "Down" "j" { GoToNextTab; }
Expand All @@ -69,7 +69,7 @@ keybinds {
bind "Tab" { ToggleTab; }
}
scroll {
bind "Ctrl s" { SwitchToMode "Normal"; }
bind "Alt s" { SwitchToMode "Normal"; }
bind "e" { EditScrollback; SwitchToMode "Normal"; }
bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
Expand All @@ -83,7 +83,7 @@ keybinds {
// bind "Alt c" { Copy; }
}
search {
bind "Ctrl s" { SwitchToMode "Normal"; }
bind "Alt s" { SwitchToMode "Normal"; }
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
bind "j" "Down" { ScrollDown; }
bind "k" "Up" { ScrollUp; }
Expand All @@ -110,7 +110,7 @@ keybinds {
bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
}
session {
bind "Ctrl o" { SwitchToMode "Normal"; }
bind "Alt o" { SwitchToMode "Normal"; }
bind "Ctrl s" { SwitchToMode "Scroll"; }
bind "d" { Detach; }
bind "w" {
Expand All @@ -123,7 +123,7 @@ keybinds {
}
tmux {
bind "[" { SwitchToMode "Scroll"; }
bind "Ctrl b" { Write 2; SwitchToMode "Normal"; }
bind "Alt b" { Write 2; SwitchToMode "Normal"; }
bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
Expand All @@ -145,11 +145,13 @@ keybinds {
bind "x" { CloseFocus; SwitchToMode "Normal"; }
}
shared_except "locked" {
bind "Ctrl g" { SwitchToMode "Locked"; }
bind "Ctrl q" { Quit; }
bind "Alt g" { SwitchToMode "Locked"; }
bind "Alt q" { Quit; }
bind "Alt n" { NewPane; }
bind "Alt i" { MoveTab "Left"; }
bind "Alt o" { MoveTab "Right"; }
bind "Alt ," { GoToPreviousTab; }
bind "Alt ." { GoToNextTab; }
bind "Alt w" { MoveTab "Left"; }
bind "Alt v" { MoveTab "Right"; }
bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
bind "Alt j" "Alt Down" { MoveFocus "Down"; }
Expand All @@ -163,25 +165,25 @@ keybinds {
bind "Enter" "Esc" { SwitchToMode "Normal"; }
}
shared_except "pane" "locked" {
bind "Ctrl p" { SwitchToMode "Pane"; }
bind "Alt p" { SwitchToMode "Pane"; }
}
shared_except "resize" "locked" {
bind "Ctrl n" { SwitchToMode "Resize"; }
bind "Alt r" { SwitchToMode "Resize"; }
}
shared_except "scroll" "locked" {
bind "Ctrl s" { SwitchToMode "Scroll"; }
bind "Alt s" { SwitchToMode "Scroll"; }
}
shared_except "session" "locked" {
bind "Ctrl o" { SwitchToMode "Session"; }
bind "Alt o" { SwitchToMode "Session"; }
}
shared_except "tab" "locked" {
bind "Ctrl t" { SwitchToMode "Tab"; }
bind "Alt t" { SwitchToMode "Tab"; }
}
shared_except "move" "locked" {
bind "Ctrl h" { SwitchToMode "Move"; }
bind "Alt m" { SwitchToMode "Move"; }
}
shared_except "tmux" "locked" {
bind "Ctrl b" { SwitchToMode "Tmux"; }
bind "Alt b" { SwitchToMode "Tmux"; }
}
}

Expand Down

0 comments on commit a964e0c

Please sign in to comment.