forked from CatalinManolescu/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
123 lines (88 loc) · 4.06 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
## improve colors
#set -g default-terminal 'screen-256color'
## act like GNU screen
unbind C-b
set -g prefix C-a
bind a send-prefix
bind b send-prefix
## enable mouse control
set -g mouse on
## list of plugins (install plugins with 'prefix + I')
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-yank \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-continuum \
tmux-plugins/vim-tmux-focus-events \
'
#tmux-plugins/tmux-yank \
## plugin configuration
set -g @yank_with_mouse on # or 'off'
set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary'
set -g @continuum-restore 'on'
set -g focus-events on
## create new windows/panes in same directory
bind c new-window -c "#{pane_current_path}"
bind "\"" split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
## enable and disable keyboard input for panes
bind < select-pane -d \; display-message "input disabled"
bind > select-pane -e \; display-message "input enabled"
## size windows based on clients looking at that window
bind-key v split-window -h
bind-key h split-window -v
## start window numbers at 1 to match keyboard order with tmux order
set -g base-index 1
## start pane numbers at 1 to match keyboard order with tmux order
setw -g pane-base-index 1
## reenable automatic renaming for the current window
bind N setw automatic-rename on \; display-message "automatic rename enabled"
## renumber windows sequentially after closing any of them
set -g renumber-windows on
## monitor windows for activity
setw -g monitor-activity on
## don't wait for escape sequences
set -sg escape-time 0
## display pane numbers for longer
set -g display-panes-time 2000
set -g status-left-length 20
set -g status-left '#{?pane_input_off,#[fg=colour160],#[fg=colour136]}[#[fg=colour136]#S:#I.#P#{?pane_input_off,#[fg=colour160],#[fg=colour136]}] '
set -g status-right '#[fg=colour166]#([ "$(tmux show-option -g prefix)" != "prefix C-a" ] && echo "($(tmux show-option -g prefix | cut -c 8-)) ")#[fg=colour33]%d %b %Y #{?client_prefix,#[fg=colour160],#[fg=colour61]}- #[fg=colour64]%I:%M %p #{?client_prefix,#[fg=colour160],#[fg=colour61]}- #[fg=colour37]#([ -f $HOME/.name ] && cat $HOME/.name || hostname)'
## increase scrollback lines
set -g history-limit 65536
## keybinding to clear history
bind C-k clear-history \; display-message "history cleared"
## C-b ! breaks current pane into separate window
## join a pane/window from the current session into the current window
bind @ command-prompt -p "create pane from:" "join-pane -s ':%%'"
## reload the .tmux.conf file with Ctrl-r
#bind C-R source-file ~/.tmux.conf \; display-message "configuration reloaded"
## toggle passthrough of prefix
bind P if-shell "[ \"$(tmux show-options -g prefix)\" = \"prefix C-a\" ]" 'set -g prefix C-b; display-message "passthrough enabled"; refresh-client -S' 'set -g prefix C-a; display-message "passthrough disabled"; refresh-client -S'
#### color (Solarized 256)
## default statusbar colors
set -g status-style bg=colour235,fg=colour136
## default window title colors
setw -g window-status-style fg=colour244
## active window title colors
setw -g window-status-current-style fg=colour166
## window activity title colors
setw -g window-status-activity-style fg=colour61
setw -g window-status-bell-style fg=colour61
## pane border
set -g pane-border-style fg=colour235
set -g pane-active-border-style fg=colour240
## message text
set -g message-style bg=colour235,fg=colour166
## pane number display
set -g display-panes-active-colour colour166 #blue
set -g display-panes-colour colour33 #orange
# ## clock
setw -g clock-mode-colour colour64 #green
## Allow local customization in ~/.tmux_local.conf
if-shell "[ -f ~/.tmux_local.conf ]" 'source ~/.tmux_local.conf'
## Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run -b '~/.tmux/plugins/tpm/tpm'