Last active 1729675626

tmux.nix Raw
1 programs.tmux = {
2 enable = true;
3 shortcut = "a";
4
5 plugins = with pkgs.tmuxPlugins; [ vim-tmux-navigator ];
6
7 terminal = "screen-256color";
8 baseIndex = 1;
9 keyMode = "vi";
10 mouse = true;
11 aggressiveResize = false;
12 clock24 = true;
13 escapeTime = 500;
14 historyLimit = 5000;
15
16 sensibleOnTop = false;
17 extraConfig =
18 let
19 binds = [
20 {
21 key = "|";
22 options = "";
23 command = "split-window -h";
24 }
25 {
26 key = "-";
27 options = "";
28 command = "split-window -v";
29 }
30 {
31 key = "h";
32 options = "-r";
33 command = "resize-pane -L 5";
34 }
35 {
36 key = "j";
37 options = "-r";
38 command = "resize-pane -D 5";
39 }
40 {
41 key = "k";
42 options = "-r";
43 command = "resize-pane -U 5";
44 }
45 {
46 key = "l";
47 options = "-r";
48 command = "resize-pane -R 5";
49 }
50 {
51 key = "m";
52 options = "-r";
53 command = "resize-pane -Z";
54 }
55 ];
56
57 unbinds = [
58 "%"
59 "\""
60 ];
61
62 bindKey = [
63 "-T copy-mode-vi 'v' send -X begin-selection"
64 "-T copy-mode-vi 'y' send -X copy-selection"
65 ];
66
67 bindConfig =
68 lib.lists.forEach binds (i: "bind ${i.key} ${i.options} ${i.command}")
69 ++ lib.lists.forEach unbinds (i: "unbind ${i}")
70 ++ lib.lists.forEach bindKey (i: "bind-key ${i}");
71 in
72 lib.concatLines bindConfig;
73 };
74