Configured tmux-sessionizer

This commit is contained in:
alejandro-angulo 2024-10-06 09:15:43 -07:00
parent 5c3d7e21ad
commit 52016deafe
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6

View file

@ -9,12 +9,25 @@
inherit (pkgs) tmuxPlugins;
cfg = config.${namespace}.apps.tmux;
tmsConfig = {
display_full_path = true;
session_sort_order = "LastAttached";
search_dirs = [
{
path = "${config.home.homeDirectory}/src";
depth = 2;
}
];
};
in {
options.${namespace}.apps.tmux = {
enable = mkEnableOption "tmux";
};
config = lib.mkIf cfg.enable {
home.packages = [pkgs.tmux-sessionizer];
programs.tmux = {
enable = true;
catppuccin.enable = true;
@ -53,7 +66,15 @@ in {
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# sessionizer
bind C-o display-popup -E "${pkgs.tmux-sessionizer}/bin/tms"
bind C-j display-popup -E "${pkgs.tmux-sessionizer}/bin/tms switch"
bind C-w display-popup -E "${pkgs.tmux-sessionizer}/bin/tms windows"
bind C-s command-prompt -p "Rename active session to:" "run-shell '${pkgs.tmux-sessionizer}/bin/tms rename %1'"
'';
};
xdg.configFile."tms/config.toml".source = (pkgs.formats.toml {}).generate "tms-config" tmsConfig;
};
}