nix-config/dots/tmux/default.nix

61 lines
1.9 KiB
Nix

{ pkgs, ... }:
{
programs.tmux = {
enable = true;
package = pkgs.tmux;
terminal = "tmux-256color";
mouse = true;
escapeTime = 0;
clock24 = true;
baseIndex= 0;
secureSocket = true;
aggressiveResize = true;
historyLimit = 10000;
prefix = "C-t";
extraConfig = ''
# Prevent detaching from tmux when closing a session.
set -g detach-on-destroy off
# Kill the current session.
bind X kill-session
# Splitting panes.
unbind v
unbind h
unbind %
unbind '"'
bind v split-window -h -c "#{pane_current_path}" # split vertically
bind V split-window -f -h -l 72 -c "#{pane_current_path}" # split vertically, but a smaller pane
bind h split-window -v -c "#{pane_current_path}" # split horizontally
bind H split-window -f -v -l 12 -c "#{pane_current_path}" # split horizontally, but a smaller pane
# Navigating panes.
bind ^ last-window
bind C-h select-pane -L
bind C-j select-pane -D
bind C-k select-pane -U
bind C-l select-pane -R
# Copy mode movements.
set-window-option -g mode-keys vi
unbind -T copy-mode-vi Space; # Default for begin-selection
unbind -T copy-mode-vi Enter; # Default for copy-selection
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
# Customizing status bar.
set -g status-position bottom
set -g status-style 'bg=#050505 fg=#C5C8C6'
set -g status-right '#[fg=colour233,bg=colour241,bold] %m/%d #[fg=colour233,bg=colour245,bold] %H:%M '
set -g status-right-length 50
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F'
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F'
'';
};
}