about summary refs log tree commit diff
path: root/home/profiles/base/config/tmux.nix
blob: 00fce8cb8b96d88c2a6fd22687d031188717c23d (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
''
  set -ga terminal-overrides ",*256col*:Tc"

  set -g default-terminal "tmux-256color" # fix display bugs

  setw -g automatic-rename on   # rename window to reflect current program
  set -g renumber-windows on    # renumber windows when a window is closed

  set -g set-titles on          # set terminal title

  set -g display-panes-time 800 # slightly longer pane indicators display time
  set -g display-time 1000      # slightly longer status messages display time

  set -g status-interval 5     # redraw status line every 5 seconds

  set -s copy-command "wl-copy" # wayland clipboard integration

  # better split bindings
  unbind '"'
  unbind %
  # splitting
  bind f if-shell "[ $(($(tmux display -p '8*#{pane_width}-20*#{pane_height}'))) -lt 0 ]" "splitw -v -c '#{pane_current_path}'" "splitw -h -c '#{pane_current_path}' "

  # reload
  bind r source-file ~/.config/tmux/tmux.conf

  bind -n C-h select-pane -L
  bind -n C-j select-pane -D
  bind -n C-k select-pane -U
  bind -n C-l select-pane -R

  bind -n C-M-h resize-pane -L 2
  bind -n C-M-j resize-pane -D 2
  bind -n C-M-k resize-pane -U 2
  bind -n C-M-l resize-pane -R 2

  bind -n M-j swap-pane -U
  bind -n M-k swap-pane -D

  # prefix-m marks window, prefix-u swaps current with marked
  bind u swap-pane

  # kill current pane
  unbind x
  bind w kill-pane

  # pane separator style
  set -g pane-border-style "fg=black bg=terminal"
  set -g pane-active-border-style "fg=black bg=black"

  # new window on n, not c
  unbind c
  unbind n
  bind n new-window

  # enable mouse operation
  set -g mouse on

  # move status line to the top
  set-option -g status-position top

  set -g status-justify right

  # transparent status background
  set-option -g status-style bg=default

  # left side length and style
  set -g status-left-length 60
  set -g status-left-style default

  # display the session name
  set -g status-left "#[fg=green] Stack #S #[default]"

  # right side length and style
  set -g status-right-length 140
  set -g status-right-style default
  set -g status-right ""

  # inactive window style
  set -g window-status-style fg=default,bg=default
  set -g window-status-format ' #I #W '
  # active window style
  set -g window-status-current-style fg=blue,bg=default
  set -g window-status-current-format ' #I #W '
''