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; }; }