summaryrefslogtreecommitdiff
path: root/modules/basic-tools/multiplexers.nix
blob: c0891284fc5a18feae814e78b3ebb3100683116c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ pkgs, ... }: {
  programs.tmux = {
    enable = true;
    keyMode = "vi";
    escapeTime = 0;
    historyLimit = 500000;
    aggressiveResize = true;
    terminal = "tmux-256color";
  };

  programs.zsh.interactiveShellInit = ''
    # create new tmux session with $1 as a name
    # if no arguments supplied, use name of current dir

    function tn {
        if [ $# -eq 0 ]
        then
            tmux new-session -s $(basename $(pwd))
        else
            tmux new-session -s $1
        fi
    }
  '';

  environment.shellAliases = {
    tl = "tmux list-sessions";
    ta = "tmux attach -t";
  };

  environment.systemPackages = [
    pkgs.screen
  ];

  programs.screen.screenrc = ''
    defscrollback 10000

    startup_message off

    hardstatus on
    hardstatus alwayslastline
    hardstatus string "%w"
  '';
}