NixOS-Configs/home/common/tmux.nix
2026-03-19 23:46:14 -05:00

76 lines
2.9 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.cpu
pkgs.tmuxPlugins.vim-tmux-navigator
pkgs.tmuxPlugins.tmux-sessionx
pkgs.tmuxPlugins.catppuccin # configured home/common/catppuccin.nix
];
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-e split-window -v gmail-filter
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";
};
}