]> Git — Sourcephile - julm/julm-nix.git/blob - home-manager/profiles/tmux.conf
htop: enable SystemdUser
[julm/julm-nix.git] / home-manager / profiles / tmux.conf
1 # Environment
2 # Reload the profile as a system update could have happened since tmux was launched.
3 set-environment -g -r __ETC_PROFILE_DONE
4 set-environment -g -r __NIXOS_SET_ENVIRONMENT_DONE
5 set-environment -g -r __HM_SESS_VARS_SOURCED
6
7 # Terminal
8 set -g default-terminal "screen-256color"
9 #set -g default-terminal "tmux"
10
11 # Activity
12 set -g monitor-activity off # NOTE: disabled to keep the bell working
13 set -g visual-activity off
14
15 # Bell
16 set -g bell-action any
17 set -g visual-bell off
18 #set -g bell-on-alert on
19
20 # Encoding
21 # DEPRECATED: set -g utf8 on
22 # DEPRECATED: set -g status-utf8 on
23
24 # Keys
25 set -g mode-keys vi
26 setw -g xterm-keys on
27
28 # Lower escape timing from 500ms to 50ms
29 # for quicker response to scroll-buffer access.
30 set -s escape-time 1
31
32 # Setting the prefix from C-b to C-a.
33 set -g prefix C-a
34 # Free the original Ctrl-b prefix keybinding.
35 unbind C-b
36 unbind-key C-b
37
38 # Window
39 bind C-c new-window -c "#{pane_current_path}"
40 bind C-p previous-window
41 bind p previous-window
42 bind C-n next-window
43 bind n next-window
44 bind -N 'Select window 8' 8 select-window -t:=8
45 bind -N 'Select window 10' 0 select-window -t:=10
46
47 # Buffer
48 bind Space choose-buffer
49
50 # Ensure that we can send Ctrl-a to other apps.
51 bind a send-prefix
52 bind-key a send-prefix
53
54 # Copy/Paste
55 bind Escape copy-mode
56 unbind [
57 unbind v
58 bind v paste-buffer -p
59 #bind -t vi-copy 'v' begin-selection
60 #bind -t vi-copy 'y' copy-selection
61 #bind -t vi-copy 'Space' halfpage-down
62 #bind -t vi-copy 'Bspace' halfpage-up
63
64 # Fill Copy/Paste clipboard
65 set -ga terminal-override ',rxvt-uni*:XT:Ms=\E]52;%p1%s;%p2%s\007'
66
67 # Allow xterm titles in terminal window, terminal scrolling with scrollbar,
68 # and setting overrides of C-Up, C-Down, C-Left, C-Right
69 #set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
70
71 # ICCCM clipboard
72 bind Y run "tmux save-buffer - | xclip -i -sel clipboard"
73 bind P run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer -p"
74 #bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
75 #bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"
76
77 # Reload the file with Ctrl-a+r
78 bind r source-file ~/.tmux.conf \; display "Reloaded!"
79
80 # Splitting panes
81 bind | split-window -h -c "#{pane_current_path}"
82 bind - split-window -v -c "#{pane_current_path}"
83
84 # Moving between panes
85 bind j select-pane -L
86 bind k select-pane -D
87 bind i select-pane -U
88 bind l select-pane -R
89
90 # Moving between windows
91 bind -r C-j select-window -t :-
92 bind -r C-l select-window -t :+
93 bind-key C-a last-window
94
95 # Pane resizing
96 bind -r J resize-pane -L 5
97 bind -r K resize-pane -D 5
98 bind -r I resize-pane -U 5
99 bind -r L resize-pane -R 5
100 # Set current window pane to 80 columns
101 bind-key 8 resize-pane -x 80
102
103 # Maximize and restore a pane
104 unbind z
105 bind z resize-pane -Z
106
107 # Log output to a text file on demand.
108 #bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
109
110 #
111 ## Mouse
112 ###
113 set -g mouse on
114 # DEPRECATED: set -g mode-mouse on
115 # DEPRECATED: set -g mouse-select-pane on
116 # DEPRECATED: set -g mouse-resize-pane on
117 # DEPRECATED: set -g mouse-select-window on
118
119 bind-key m set -g mouse on \; display 'Mouse: ON'
120 bind-key M set -g mouse off \; display 'Mouse: OFF'
121
122 # tmux < 2.5
123 #bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'
124 # tmux >= 2.5
125 #bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
126
127 # To copy, left click and drag to highlight text in yellow,
128 # once you release left click yellow text will disappear and will automatically be available in clibboard
129 # Update default binding of `Enter` to also use copy-pipe
130 #unbind -T copy-mode-vi Enter
131 #bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
132 #bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
133
134 # Mouse scroll
135 # see https://github.com/tmux/tmux/issues/145#issuecomment-150736967
136 #bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
137 #bind -n WheelDownPane select-pane -t= \; send-keys -M
138 #bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
139 #bind -t vi-copy C-WheelUpPane halfpage-up
140 #bind -t vi-copy C-WheelDownPane halfpage-down
141
142 #bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
143 #bind -n WheelDownPane select-pane -t= \; send-keys -M
144 #bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
145 #bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
146 #bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
147 #bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
148 #bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
149
150 #
151 ## Style
152 ###
153
154 # pane
155 set -g pane-base-index 1
156 set -g pane-border-style 'fg=green,bg=black'
157 set -g pane-active-border-style 'fg=white,bg=yellow'
158 set -g pane-border-style 'fg=colour245'
159 set -g pane-active-border-style 'bg=colour39'
160 set -g pane-active-border-style 'fg=green,bg=black'
161 set -g pane-border-style 'fg=white,bg=black'
162 #set -g pane-border-status bottom
163 #set -g pane-border-format " #P: #{pane_current_command} "
164 #set -g pane-border-format " #P: #{pane_current_path} "
165
166 # window
167 setw -g base-index 1
168 setw -g aggressive-resize on
169 setw -g window-size latest
170 setw -g window-status-activity-style 'fg=yellow'
171 setw -g window-status-bell-style 'fg=red'
172 setw -g window-status-current-format "#I #W "
173 setw -g window-status-current-style 'fg=white'
174 setw -g window-status-format "#I #W "
175 setw -g window-status-style 'fg=blue,bg=black'
176
177 # window title
178 setw -g set-titles on
179 setw -g set-titles-string "#T"
180 setw -g allow-rename on
181 setw -g automatic-rename off
182 #set -g automatic-rename-format '#{b:pane_current_path}'
183
184 # message
185 set -g message-style 'fg=black,bg=green'
186
187 # status
188 set -g status-left-length 52
189 set -g status-right-length 451
190 set -g status-justify left
191 set -g status-style 'fg=white,bg=black'
192 set -g status-left-length 40
193 set -g status-right-length 80
194 set -g status-left ""
195 set -g status-right '#[fg=red]#h'
196 #set -g status-interval 5
197 #set -g status-justify centre
198
199 # Solarized color.
200 #source-file ~/.tmux/vendor/tmux-colors-solarized/tmuxcolors.conf
201
202 # plugins
203 ## List of plugins
204 #set -g @plugin 'tmux-plugins/tpm'
205 #set -g @plugin 'tmux-plugins/tmux-sensible'
206 #set -g @plugin 'tmux-plugins/tmux-yank'
207 #set -g @yank_selection 'clipboard' # 'primary', or 'secondary' or 'clipboard'
208
209 # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
210 #run -b '~/.tmux/plugins/tpm/tpm'
211