From dccb037942397584468f165bca0ce369551643a6 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 17 Jun 2024 14:04:09 +0100 Subject: [PATCH] [yevaud] Set up tmux --- home/tmux.nix | 33 +++++++++++++++++++++++++++++++++ hosts/yevaud/home.nix | 1 + 2 files changed, 34 insertions(+) create mode 100644 home/tmux.nix diff --git a/home/tmux.nix b/home/tmux.nix new file mode 100644 index 0000000..407a517 --- /dev/null +++ b/home/tmux.nix @@ -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}" + ''; + }; +} diff --git a/hosts/yevaud/home.nix b/hosts/yevaud/home.nix index de2439b..a79e622 100644 --- a/hosts/yevaud/home.nix +++ b/hosts/yevaud/home.nix @@ -4,6 +4,7 @@ home-manager.users.qenya = { pkgs, ... }: { imports = [ ../../home/cli.nix + ../../home/tmux.nix ]; home.stateVersion = "23.11";