-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
129 lines (102 loc) · 4.11 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# improve colors
set -g default-terminal 'screen-256color'
# act like vim
setw -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key X set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# Use 256 colors in tmux.
set -g default-terminal screen-256color
# Use vi key bindings in tmux.
set -g mode-keys vi
# Vim-like pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Vim-like copy/yank
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
# for linux, comment line above and use below (or omit "pbcopy"):
# bind-key -T copy-mode-vi y send -X copy-selection-and-cancel
bind P paste-buffer # shift-p to paste buffer
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# for linux, comment line above and use below (or omit "pbcopy"):
#bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
# Open a new pane or window with the current directory of the current pane, not the directory in which the first tmux session was started.
# Here the -c option is used to specify the start directory for the new pane. The current path is represented with the replacement variable pane_current_path in the commands above.
# The -h option specifies that the window should be split into left and right panes.
# use <prefix> s for horizontal split
bind s split-window -v -c "#{pane_current_path}"
# use <prefix> v for vertical split
bind v split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# resize panes more easily
bind < resize-pane -L 10
bind > resize-pane -R 10
bind - resize-pane -D 10
bind + resize-pane -U 10
# increase scrollback lines
set -g history-limit 10000
# prefix -> back-one-character
bind-key C-b send-prefix
# prefix-2 -> forward-incremental-history-search
bind-key C-s send-prefix -2
# don't suspend-client
unbind-key C-z
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-net-speed'
set -g @plugin 'samoshkin/tmux-plugin-sysstat'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-battery'
# Plugin configs
# Continuum Config
## Restore Neovim sessions
set -g @resurrect-strategy-nvim 'session'
## Restore Panes
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm'
# General config
set -g @net_speed_interfaces "eth0 eth1"
## window config
set-window-option -g window-status-style fg=magenta
set-window-option -g window-status-style bg=default
## status line configs
### soften status bar color from harsh green to light gray
##set -g status-bg '#666666'
##set -g status-fg '#aaaaaa'
set-option -g status-bg default
set-option -g status-fg colour240
set-option -g status-interval 15
set -g status-left-length 150
set -g status-left "working on#[fg=magenta] #S #[fg=green] / %d %b %Y / %H:%M"
set -g status-right-length 150
set -g status-right '#{battery_fg_color}#{battery_icon}: #{battery_percentage} / #{cpu_fg_color} CPU: #{cpu_icon} #{cpu_percentage} / #[fg=green] #{net_speed} #[fg=yellow]/ conti: #{continuum_status}'
set -g status-style bg=default
set -g status-justify centre
## Continuum save interval
set -g @continuum-save-interval '5'
# Local config
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
# nvim recommendation
set-option -sg escape-time 10
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'