Skip to content

Commit

Permalink
🔧 zellij config
Browse files Browse the repository at this point in the history
  • Loading branch information
shelken committed Oct 24, 2024
1 parent 9b641fe commit 8d4cbf6
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 13 deletions.
11 changes: 0 additions & 11 deletions home/apps/zellij/config.kdl

This file was deleted.

41 changes: 39 additions & 2 deletions home/apps/zellij/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
{
myvars,
lib,
pkgs,
...
}: let
theme = "catppuccin-${lib.strings.toLower myvars.catppuccin_flavor}";
origin_file = builtins.readFile ./config.kdl;
# origin_file = builtins.readFile ./config.kdl;
keybinds-config = builtins.readFile ./keybinds.kdl;
inherit (lib) concatStrings;
zellij-forgot = pkgs.stdenv.mkDerivation rec {
pname = "zellij-forgot";
version = "0.4.0";

src = builtins.fetchurl {
url = "https://github.com/karimould/zellij-forgot/releases/download/${version}/zellij_forgot.wasm";
sha256 = "sha256:1hzdvyswi6gh4ngxnplay69w1n8wlk17yflfpwfhv6mdn0gcmlsr";
};
phases = ["installPhase"];

installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/zellij_forgot.wasm
'';
};
in {
programs.zellij = {
enable = true;
Expand All @@ -21,8 +38,28 @@ in {
''
// 主题配色
theme "${theme}"
session_serialization true
simplified_ui false
''
''
//键盘绑定
keybinds {
${keybinds-config}
// 参考:https://github.com/nixypanda/dotfiles/blob/f5d4bb5a1efd006f1db3e29965a12dea09f10356/modules/zellij/default.nix#L56C11-L63C12
// 插件:命令提示
shared_except "locked" {
bind "Ctrl y" {
LaunchOrFocusPlugin "file:${zellij-forgot}/bin/zellij_forgot.wasm" {
"LOAD_ZELLIJ_BINDINGS" "true"
floating true
}
}
}
}
''
origin_file
# origin_file
];
};
}
14 changes: 14 additions & 0 deletions home/apps/zellij/keybinds.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// theme "catppuccin-macchiato"

// session_serialization true

// keybinds {
normal {
// bind "Ctrl x" { SwitchToMode "Normal"; }
unbind "Ctrl q" "Ctrl s" "Ctrl o" "Ctrl h"// for vim
bind "Ctrl f" { SwitchToMode "Scroll"; }
bind "Ctrl x" { Quit; }
bind "Alt o" { SwitchToMode "Session"; }
bind "Alt h" { SwitchToMode "Move"; }
}
// }

0 comments on commit 8d4cbf6

Please sign in to comment.