summaryrefslogtreecommitdiff
path: root/modules/tmux.nix
blob: a049d39e66581de3f9ad7066525a8c4f66c7afb8 (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
44
45
46
47
48
49
50
51
52
{ config, pkgs, ... }:

{
  programs.tmux = {
    enable = true;
    extraConfig = ''
      set -g default-terminal "xterm-256color"
      set -g history-limit 50000
      set -g base-index 1
      set -s escape-time 0
      set -g mouse on
      set-option -g prefix C-a
      unbind-key C-b
      bind-key C-a send-prefix
      bind h select-pane -L
      bind j select-pane -D
      bind k select-pane -U
      bind l select-pane -R
      bind r source-file ~/.tmux.conf
      
      # Enable vi keys.
      setw -g mode-keys vi
      
      # Escape turns on copy mode
      bind Escape copy-mode
      
      # v in copy mode starts making selection
      bind-key -T copy-mode v send -X begin-selection
      bind-key -T copy-mode y send -X copy-selection
      
      # make Prefix p paste the buffer.
      unbind p
      bind p paste-buffer
      
      set-option -g status-position top
      set -g pane-border-style fg=colour8
      set -g pane-active-border-style fg=colour8
      
      set -g status-justify right
      set -g status-right ""
      set -g status-left ""
      set -g status-style "bg=default"
      set -ag status-style "fg=colour7"
      
      set -g window-status-current-format "#[fg=colour15]    #W"
      set -g window-status-format "#[fg=colour8]    #W"
      
      set -g status-left-length 100
      set -ag status-left "#[fg=colour8]time #[fg=colour15]#(date +"%I:%M%p") "
    '';
  };
}