-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
127 lines (97 loc) · 3.48 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
# https://gist.github.com/CSaratakij/1e84ecc2fc052c3b10eb5fcdf371319d
# Messages display time
set-option -g display-time 300
set-option -g message-style bg=yellow,fg=black
set-option -g message-command-style bg=yellow,fg=black
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+
# How long will the pane number be displayed (before it disappears)
set -g display-panes-time 2000 #2s
bind-key x kill-pane
# bind-key & kill-window
# Mouse support
set -g mouse on
# Enable mouse scroll, see https://github.com/tmux/tmux/issues/145#issuecomment-150736967
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# see: http://stackoverflow.com/a/15550847/963881
# set timeoutlen=1000 ttimeoutlen=0
# and: https://github.com/microsoft/WSL/issues/5931#issuecomment-1296783606
set -sg escape-time 1
# set-option -g default-terminal "screen-256color"
set -g default-terminal "tmux-256color"
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# Switch windows alt+number
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
bind-key -n M-0 select-window -t 10
# unbind /
# bind / split-window -h
# unbind .
# bind . split-window -v
set-option -g allow-rename off
# 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 @continuum-restore 'on'
# Color scheme (Cobalt)
# default statusbar colors
set-option -g status-fg white
set-option -g status-bg cyan
# active window title colors
set-window-option -g window-status-current-style fg=red,bg=yellow
# pane border
set-option -g pane-border-style fg=cyan
set-option -g pane-active-border-style fg=red
# pane number display
set-option -g display-panes-active-colour red
set-option -g display-panes-colour cyan
# kill selected Pane
bind-key Q kill-pane
bind-key a set-window-option synchronize-panes on\; send-keys C-l \; set-window-option synchronize-panes off
bind-key s set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
# Use zsh
set-option -g default-shell '/bin/zsh'
STARTUP_DIRECTORY="~/core"
# Startup options
# choose-tree
new-session -s base -c '#{STARTUP_DIRECTORY}'
split-window -h -c '#{STARTUP_DIRECTORY}'
split-window -v -c "~/dotfiles"
select-pane -t 0
split-window -v -c '#{STARTUP_DIRECTORY}'
# tmux send-keys -t development:1 'cd /var/www/htdocs/' C-m
send-keys -t 0 '~/dotfiles/tmux_startup.sh' Enter
select-pane -t 0
# Clear panes history in case there was anhything added
# (due to terminal bug, etc.)
# setw synchronize-panes on
# clear-history
# setw synchronize-panes off