nixos-config/modules/tmux.nix

67 lines
1.8 KiB
Nix

{ pkgs, config, ... }:
{
programs.tmux = {
enable = true;
shortcut = "b";
# aggressiveResize = true; -- Disabled to be iTerm-friendly
baseIndex = 1;
# newSession = true;
# Stop tmux+escape craziness.
escapeTime = 0;
secureSocket = true;
plugins = with pkgs; [
tmuxPlugins.better-mouse-mode
tmuxPlugins.sidebar
tmuxPlugins.nord
];
extraConfig = ''
# scrollback size
set -g history-limit 50000
# https://old.reddit.com/r/tmux/comments/mesrci/tmux_2_doesnt_seem_to_use_256_colors/
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set-environment -g COLORTERM "truecolor"
# Mouse works as expected
set-option -g mouse on
# Redraw the client (if interrupted by wall, etc)
bind R refresh-client
# reload tmux config with ctrl + b + r
unbind r
bind r \
source-file ~/.tmux.conf \;\
display 'Reloaded tmux config.'
# C + control q to kill sessio
unbind q
unbind C-q
bind-key q kill-session
bind-key C-q kill-session
# Switching panes with alt
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Visual Activity Monitoring between windows
setw -g monitor-activity on
set -g visual-activity on
# Show tmux positions in titles
set -g set-titles on
# Attach to a session if runs otherwise create a new one
new-session -n DRI
'';
};
# programs.tmate = {
# enable = true;
# FIXME: This causes tmate to hang.
# extraConfig = config.xdg.configFile."tmux/tmux.conf".text;
# };
}