-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
120 lines (95 loc) · 3.92 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
# Prefix shoulb be b (ctrl + b)
set -g prefix ^b
set-option -g history-limit 4000
set-option -g default-shell "${SHELL}"
# use vim keybindings in copy mode
setw -g mode-keys vi
set -g focus-events off
# Tmux should be pretty, we need 256 color for that
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# Synchronize between all panes
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# Set the time in milliseconds for which tmux waits after an escape is input to
# determine if it is part of a function or meta key sequences.
# The default is 500 milliseconds.
set -sg escape-time 1
# Start counting from 1 (defult is 0)
set-option -g base-index 1
setw -g pane-base-index 1
# reload ~/.tmux.conf using PREFIX r
bind r source-file ~/.tmux.conf \; display "Configuration reloaded!"
# use | to split window horizontally and - to split vertically
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind-key c new-window -c '#{pane_current_path}'
# map Vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# ----------------------
# Status Bar
# -----------------------
set-option -g status on
set -g status-interval 5
set -g status-justify centre
# Uncomment to change the status bar position to top
# set-option -g status-position top
# set color for status bar
set-option -g status-bg colour235
set-option -g status-fg yellow
# show host name and IP address on left side of status bar
set -g status-left-length 120
set -g status-left "#[fg=green]| ${USER}@#h |"
# show session name, window & pane number, date and time on right side of
# status bar
set -g status-right-length 60
set -g status-right "#[fg=blue]| %H:%M | #[fg=yellow]%d %b %Y | "
# set titles
set -g set-titles on
set -g set-titles-string "#T : #h"
# NOTE: Yank (y) is done by the tmux-yank plugin (at the end of the file)
# NOTE: The key binding for copy mode was changed recently;
# https://github.com/tmux/tmux/issues/754
unbind-key -T copy-mode-vi Space ; bind-key -T copy-mode-vi v send-keys -X begin-selection
unbind-key -T copy-mode-vi C-v ; bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
unbind-key -T copy-mode-vi [ ; bind-key -T copy-mode-vi [ send-keys -X begin-selection
unbind-key -T copy-mode-vi ] ; bind-key -T copy-mode-vi ] send-keys -X copy-selection
# visual notification of activity in other windows
setw -g monitor-activity on
set -g visual-activity off
# Resize panes Shift + Up/Down/Left/Right
bind-key -n S-Up resize-pane -U 5
bind-key -n S-Down resize-pane -D 5
bind-key -n S-Left resize-pane -L 10
bind-key -n S-Right resize-pane -R 10
# Bind F12 to control outer (ssh) or inner (local) session
# Useful for when we want to nested tmux session and not press prefix
# twice
bind -T root F12 \
set prefix None \;\
set key-table off \;\
display "Nested tmux session"
refresh-client -S
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
display "Local tmux"
refresh-client -S
# Needed for tmux-yank plugin
# set-option -g default-command 'reattach-to-user-namespace -l zsh'
# List of plugins
set -g @plugin 'tmux-plugins/tpm' # https://github.com/tmux-plugins/tpm */
set -g @plugin 'tmux-plugins/tmux-yank' # https://github.com/tmux-plugins/tmux-yank
# NOTE this requires urlview; `brew install urlview`
# Use with prefix => u (ctrl + b => u)
set -g @plugin 'tmux-plugins/tmux-urlview' # https://github.com/tmux-plugins/tmux-urlview
# Usage: prefix => ctrl + s to save env (ctrl + b => ctrl + s)
# prefix => ctrl + r to restore env (ctrl + b => ctrl + r)
set -g @plugin 'tmux-plugins/tmux-resurrect' # https://github.com/tmux-plugins/tmux-resurrect
# Plugins config
set -g @yank_selection 'clipboard' # tmux-yank clipboard
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'