From 52016deafebf68d951e6eb7878e2cbb049186a8e Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Sun, 6 Oct 2024 09:15:43 -0700 Subject: [PATCH] Configured tmux-sessionizer --- modules/home/apps/tmux/default.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/modules/home/apps/tmux/default.nix b/modules/home/apps/tmux/default.nix index 96095d3..d974773 100644 --- a/modules/home/apps/tmux/default.nix +++ b/modules/home/apps/tmux/default.nix @@ -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; }; }