NixOS-Configs/home/common/tmux.nix
2025-08-28 22:37:46 -05:00

92 lines
3.6 KiB
Nix

{pkgs, ...}: {
programs.tmux = {
enable = true;
aggressiveResize = true;
sensibleOnTop = false;
historyLimit = 2000;
tmuxinator.enable = true;
mouse = false;
baseIndex = 1;
disableConfirmationPrompt = true;
terminal = "tmux-256color";
keyMode = "vi";
plugins = [
pkgs.tmuxPlugins.battery
pkgs.tmuxPlugins.cpu
pkgs.tmuxPlugins.vim-tmux-navigator
{
plugin = pkgs.tmuxPlugins.catppuccin;
extraConfig = ''
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_date_time_text "%_m/%e %l:%M %p"
set -g @catppuccin_window_status_style "rounded"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_text " #[italics]#{window_name}"
set -g @catppuccin_window_status "no"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_number_position "left"
set -g status-style "bg=terminal"
set -g status-left "#{E:@catppuccin_status_session}"
set -gF status-right "#{E:@catppuccin_status_cpu}"
set -ag status-right "#{E:@catppuccin_status_mem}"
set -ag status-right "#{E:@catppuccin_status_date_time}"
'';
}
];
extraConfig = ''
bind '~' split-window "exec btop"
bind - split-window -v -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind -n C-1 select-window -t 11
bind -n C-2 select-window -t 12
bind -n C-3 select-window -t 13
bind -n C-4 select-window -t 14
bind 0 select-window -t 10
bind C-0 select-window -t 20
bind C-5 select-window -t 15
bind C-6 select-window -t 16
bind C-7 select-window -t 17
bind C-8 select-window -t 18
bind C-9 select-window -t 19
bind C-c run "tmux show-buffer | wl-copy"
bind C-g display-popup -d "#{pane_current_path}" -w 80% -h 80% -E "lazygit"
bind C-j display-popup -E "tmux list-sessions | sed -E 's/:.*$//' | fzf --reverse | xargs tmux switch-client -t"
bind C-o display-popup -w 90% -h 90% -E "ttmenu"
bind C-n display-popup -E 'bash -i -c "read -p "Session name: \" name; tmux new-session -d -s \$name && tmux switch-client -t \$name"'
bind C-r display-popup -d "#{pane_current_path}" -w 90% -h 90% -E "lf"
bind C-n neww -n net "exec $TEXTWEB"
bind C-t neww -n vit "exec vit"
bind C-v run "tmux set-buffer -- \"$(wl-paste)\"; tmux paste-buffer"
bind I display-popup -w 90% -h 90% -E "ikhal"
bind S split-window -v -l 5
bind T display-popup -d "#{pane_current_path}" -w 90% -h 90% -E "bash"
bind Tab choose-window
bind ^b last-window
bind e setw synchronize-panes
bind g select-layout tiled
bind o select-pane -t :.-
bind u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlscan" '$SHELL -c "urlscan -c -d < /tmp/tmux-buffer"'
set -g bell-action any
set -g buffer-limit 9
set -g display-panes-time 1000
set -g display-time 750
set -g focus-events on
set -g renumber-windows off
set -g status on
set -g status-interval 15
set -g status-justify left
set -g status-position top
set -g visual-activity off
set -g visual-bell off
set -sa terminal-features ',tmux-256color:RGB'
# set -sa terminal-overrides ",tmux-256color:RGB"
set -sa terminal-overrides ",xterm*:Tc"
set -sg escape-time 0
'';
};
xdg.configFile."tmuxinator" = {
recursive = true;
source = ./files/tmuxinator;
target = "tmuxinator";
};
}