-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
90 lines (73 loc) · 3.28 KB
/
tmux.conf
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
86
87
88
89
90
# Convenient way to reload config file.
bind-key r source-file ~/.tmux.conf
# Set terminal to use 256 colors.
set -g default-terminal "screen-256color"
# Use Vi mode.
setw -g mode-keys vi
set-option -g status-keys vi
# Set the clock mode style to 12-hr format.
set-option -g clock-mode-style 12
bind T clock-mode
unbind t
# Bind commands for window splitting.
bind c new-window -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind h select-layout even-horizontal
bind H select-layout main-horizontal
bind v select-layout even-vertical
bind V select-layout main-vertical
bind t select-layout tiled
# Bind commands for pane resizing.
bind + resize-pane -U 5
bind _ resize-pane -D 5
bind ( resize-pane -L 5
bind ) resize-pane -R 5
# Version-specific commands [grumble, grumble]
# See: https://github.com/tmux/tmux/blob/master/CHANGES
# url: https://stackoverflow.com/a/40902312
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c -8 | cut -d' ' -f2)"
# UTF8 is autodetected in 2.2 onwards, but errors if explicitly set
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.2" | bc)" = 1 ]' \
"set -g utf8 on; set -g status-utf8 on; set -g mouse-utf8 on"
# Legacy support for mouse mode
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.1" | bc)" = 1 ]' "\
set -g mouse-select-pane on; \
set -g mode-mouse on; \
set -g mouse-resize-pane on; \
set -g mouse-select-window on"
# In version 2.1 "mouse" replaced the previous 4 mouse options
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.1" | bc)" = 1 ]' \
"set -g mouse on"
# UTF8 is autodetected in 2.2 onwards, but errors if explicitly set
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.2" | bc)" = 1 ]' \
"set -g utf8 on; set -g status-utf8 on; set -g mouse-utf8 on"
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
bind-key -T copy-mode-vi WheelUpPane send -X halfpage-up
bind-key -T copy-mode-vi WheelDownPane send -X halfpage-down
# Enable copy mode using PgUp/PgDown
bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
bind-key -T copy-mode-vi PPage send -X page-up
bind-key -T copy-mode-vi NPage send -X page-down
# Allows scrolling history and keeps line placement.
set-window-option -g alternate-screen on
set -g history-limit 4096
set -g terminal-overrides "xterm*:smcup@:rmcup@"
# Restore clear screen binding
# url: https://github.com/christoomey/vim-tmux-navigator
bind l send-keys 'C-l'
bind k send-keys 'C-k'
# Configure Dracula plugins
# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, network, network-bandwidth, network-ping, weather, time
set -g @dracula-plugins "network cpu-usage ram-usage battery"
set -g @dracula-show-left-icon "session"
set -g @dracula-ram-usage-colors "light_purple dark_gray"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'dracula/tmux'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'