hx-zellij

This commit is contained in:
elwrcl committed 2026-08-19 13:21:21 +03:00
1 parent 184e3e97a4
commit a430d19d44
14 files changed
+1139 -3

No files matched your search

@@ -0,0 +1,39 @@
{ ... }:
{
flake.homeModules.home-zellij-ide-command =
{ config, pkgs, ... }:
{
home.packages = [
(pkgs.writeShellApplication {
name = "ide";
runtimeInputs = [
config.programs.zellij.finalPackage
pkgs.coreutils
pkgs.gnugrep
];
text = ''
case "''${1:-}" in
-h | --help)
echo "usage: ide [directory]"
echo
echo "opens re-attaches to a Zellij session named after the"
echo "directory, running Helix in the 'ide' layout."
exit 0
;;
esac
cd "''${1:-.}"
session=$(basename "$PWD")
session=$(printf '%s' "$session" | tr -c 'A-Za-z0-9._-' '-')
if zellij list-sessions --short 2>/dev/null | grep -qx "$session"; then
exec zellij attach "$session"
fi
exec zellij --session "$session" --new-session-with-layout ide
'';
})
];
};
}
@@ -0,0 +1,176 @@
{ ... }:
{
flake.homeModules.home-zellij-keybinds =
{ ... }:
{
programs.zellij.extraConfig = ''
keybinds clear-defaults=true {
normal {
bind "Ctrl g" { SwitchToMode "Tmux"; }
}
locked {
bind "Ctrl g" { SwitchToMode "Normal"; }
}
tmux {
bind "Ctrl g" { Write 7; SwitchToMode "Normal"; }
// panes
bind "-" "\"" { NewPane "Down"; SwitchToMode "Normal"; }
bind "\\" "%" { NewPane "Right"; SwitchToMode "Normal"; }
bind "n" { NewPane; SwitchToMode "Normal"; }
bind "x" { CloseFocus; SwitchToMode "Normal"; }
bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
bind "i" { TogglePanePinned; SwitchToMode "Normal"; }
bind "Space" { NextSwapLayout; SwitchToMode "Normal"; }
// focus
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 "o" { FocusNextPane; SwitchToMode "Normal"; }
// moving panes around
bind "H" { MovePane "Left"; SwitchToMode "Normal"; }
bind "J" { MovePane "Down"; SwitchToMode "Normal"; }
bind "K" { MovePane "Up"; SwitchToMode "Normal"; }
bind "L" { MovePane "Right"; SwitchToMode "Normal"; }
// tabs
bind "c" { NewTab; SwitchToMode "Normal"; }
bind "," { SwitchToMode "RenameTab"; TabNameInput 0; }
bind "X" { CloseTab; SwitchToMode "Normal"; }
bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
bind "b" { BreakPane; SwitchToMode "Normal"; }
bind "Tab" { ToggleTab; 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"; }
// sub-modes
bind "r" { SwitchToMode "Resize"; }
bind "[" { SwitchToMode "Scroll"; }
bind "/" { SwitchToMode "EnterSearch"; SearchInput 0; }
// tools, as floating panes over the editor
bind "g" {
Run "lazyjj" {
floating true
close_on_exit true
name "lazyjj"
}
SwitchToMode "Normal"
}
bind "G" {
Run "lazygit" {
floating true
close_on_exit true
name "lazygit"
}
SwitchToMode "Normal"
}
bind "t" {
Run "nu" {
floating true
close_on_exit true
name "shell"
}
SwitchToMode "Normal"
}
bind "y" {
Run "yazi" {
floating true
close_on_exit true
name "files"
}
SwitchToMode "Normal"
}
bind "f" {
LaunchOrFocusPlugin "filepicker" {
floating true
move_to_focused_tab true
}
SwitchToMode "Normal"
}
bind "s" {
LaunchOrFocusPlugin "session-manager" {
floating true
move_to_focused_tab true
}
SwitchToMode "Normal"
}
// session
bind "d" { Detach; }
bind "Q" { Quit; }
}
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 "j" "Down" { ScrollDown; }
bind "k" "Up" { ScrollUp; }
bind "d" { HalfPageScrollDown; }
bind "u" { HalfPageScrollUp; }
bind "Ctrl f" "PageDown" { PageScrollDown; }
bind "Ctrl b" "PageUp" { PageScrollUp; }
bind "G" { ScrollToBottom; SwitchToMode "Normal"; }
bind "e" { EditScrollback; SwitchToMode "Normal"; }
bind "/" { SwitchToMode "EnterSearch"; SearchInput 0; }
}
search {
bind "j" "Down" { ScrollDown; }
bind "k" "Up" { ScrollUp; }
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 "Normal"; }
}
renamepane {
bind "Ctrl c" { SwitchToMode "Normal"; }
bind "Esc" { UndoRenamePane; SwitchToMode "Normal"; }
}
shared_except "normal" "locked" "entersearch" "renametab" "renamepane" {
bind "Enter" "Esc" { SwitchToMode "Normal"; }
}
}
'';
};
}
@@ -0,0 +1,23 @@
{ ... }:
{
flake.homeModules.home-zellij-layout-ide =
{ ... }:
{
programs.zellij.layouts.ide = ''
layout {
default_tab_template {
pane size=1 borderless=true {
plugin location="zellij:compact-bar"
}
children
}
tab name="edit" focus=true {
pane command="hx" close_on_exit=true {
args "."
}
}
}
'';
};
}
@@ -0,0 +1,130 @@
{ ... }:
{
flake.homeModules.home-zellij-theme =
{ ... }:
# this could be change
{
programs.zellij.themes.kanagawa-dragon-copnix = ''
themes {
kanagawa-dragon-copnix {
text_unselected {
base 197 201 199
background 9 14 19
emphasis_0 182 146 123
emphasis_1 127 180 202
emphasis_2 138 154 123
emphasis_3 162 146 163
}
text_selected {
base 9 14 19
background 127 180 202
emphasis_0 182 146 123
emphasis_1 9 14 19
emphasis_2 138 154 123
emphasis_3 162 146 163
}
ribbon_selected {
base 9 14 19
background 127 180 202
emphasis_0 196 116 110
emphasis_1 182 146 123
emphasis_2 162 146 163
emphasis_3 139 164 176
}
ribbon_unselected {
base 197 201 199
background 34 38 45
emphasis_0 196 116 110
emphasis_1 197 201 199
emphasis_2 139 164 176
emphasis_3 162 146 163
}
table_title {
base 138 154 123
background 0
emphasis_0 182 146 123
emphasis_1 127 180 202
emphasis_2 138 154 123
emphasis_3 162 146 163
}
table_cell_selected {
base 9 14 19
background 127 180 202
emphasis_0 182 146 123
emphasis_1 9 14 19
emphasis_2 138 154 123
emphasis_3 162 146 163
}
table_cell_unselected {
base 197 201 199
background 9 14 19
emphasis_0 182 146 123
emphasis_1 127 180 202
emphasis_2 138 154 123
emphasis_3 162 146 163
}
list_selected {
base 9 14 19
background 127 180 202
emphasis_0 182 146 123
emphasis_1 9 14 19
emphasis_2 138 154 123
emphasis_3 162 146 163
}
list_unselected {
base 197 201 199
background 9 14 19
emphasis_0 182 146 123
emphasis_1 127 180 202
emphasis_2 138 154 123
emphasis_3 162 146 163
}
frame_selected {
base 127 180 202
background 0
emphasis_0 182 146 123
emphasis_1 138 154 123
emphasis_2 162 146 163
emphasis_3 0
}
frame_highlight {
base 182 146 123
background 0
emphasis_0 162 146 163
emphasis_1 182 146 123
emphasis_2 182 146 123
emphasis_3 182 146 123
}
exit_code_success {
base 138 154 123
background 0
emphasis_0 127 180 202
emphasis_1 9 14 19
emphasis_2 162 146 163
emphasis_3 139 164 176
}
exit_code_error {
base 228 104 118
background 0
emphasis_0 230 195 132
emphasis_1 0
emphasis_2 0
emphasis_3 0
}
multiplayer_user_colors {
player_1 162 146 163
player_2 139 164 176
player_3 0
player_4 230 195 132
player_5 127 180 202
player_6 0
player_7 196 116 110
player_8 0
player_9 0
player_10 0
}
}
}
'';
};
}
+32
View File
@@ -0,0 +1,32 @@
{ ... }:
{
flake.homeModules.home-zellij =
{ ... }:
{
programs.zellij = {
enable = true;
settings = {
theme = "kanagawa-dragon-copnix";
default_layout = "compact";
default_mode = "normal";
default_shell = "nu";
pane_frames = false;
ui.pane_frames.rounded_corners = true;
mouse_mode = true;
copy_command = "wl-copy";
copy_on_select = true;
styled_underlines = true;
support_kitty_keyboard_protocol = true;
stacked_resize = true;
scroll_buffer_size = 50000;
scrollback_editor = "hx";
session_serialization = true;
serialize_pane_viewport = true;
on_force_close = "detach";
show_startup_tips = false;
show_release_notes = false;
};
};
};
}