[yevaud] Set up tmux

This commit is contained in:
Katherina Walshe-Grey 2024-06-17 14:04:09 +01:00
parent 785184c7ef
commit dccb037942
2 changed files with 34 additions and 0 deletions

33
home/tmux.nix Normal file
View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
{
# Derived from https://github.com/srid/nixos-config/blob/master/home/tmux.nix
programs.tmux = {
enable = true;
clock24 = true;
shortcut = "a"; # `screen` muscle memory compatibility
baseIndex = 1; # this is a UI, 0-indexing is not appropriate, fight me
newSession = true; # skip the manual step
escapeTime = 0; # otherwise I keep reflexively hammering Esc
secureSocket = false; # make sessions survive user logout
plugins = with pkgs; [
tmuxPlugins.better-mouse-mode
];
mouse = true;
extraConfig = ''
# 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"
# easy-to-remember split pane commands
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
'';
};
}

View file

@ -4,6 +4,7 @@
home-manager.users.qenya = { pkgs, ... }: { home-manager.users.qenya = { pkgs, ... }: {
imports = [ imports = [
../../home/cli.nix ../../home/cli.nix
../../home/tmux.nix
]; ];
home.stateVersion = "23.11"; home.stateVersion = "23.11";