-
Notifications
You must be signed in to change notification settings - Fork 8
/
tmux.remote.conf
154 lines (134 loc) · 7.05 KB
/
tmux.remote.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#####################################################################################
## ##
## ████████╗███╗ ███╗██╗ ██╗██╗ ██╗ ██████╗ ██████╗ ███╗ ██╗███████╗ ##
## ╚══██╔══╝████╗ ████║██║ ██║╚██╗██╔╝ ██╔════╝██╔═══██╗████╗ ██║██╔════╝ ##
## ██║ ██╔████╔██║██║ ██║ ╚███╔╝ ██║ ██║ ██║██╔██╗ ██║█████╗ ##
## ██║ ██║╚██╔╝██║██║ ██║ ██╔██╗ ██║ ██║ ██║██║╚██╗██║██╔══╝ ##
## ██║ ██║ ╚═╝ ██║╚██████╔╝██╔╝ ██╗.remote.██████╗╚██████╔╝██║ ╚████║██║ ##
## ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ##
## ##
#####################################################################################
# misc. {{{
set-option -g default-shell "/usr/bin/bash"
set-option -sg default-terminal "tmux-256color"
set-option -ga terminal-overrides ",*256col*:Tc"
set-option -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
set-option -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set-option -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours
set-option -sg escape-time 30
set-option -g focus-events on
set-option -g mouse on
set-option -g status-keys vi
set-option -g set-clipboard on
set-option -g history-limit 50000
set-option -g focus-events on
set-option -g allow-passthrough on
set-option -g display-time 5000
set-option -s copy-command 'xclip -selection clipboard'
set-window-option -gq utf8 on
set-window-option -g monitor-activity on
set-window-option -g mode-keys vi
set-window-option -g automatic-rename on
# }}}
# command-message-status-style {{{
set -g message-style 'bg=black,fg=green'
set -g message-command-style 'bg=black,fg=yellow'
# }}}
# Titles {{{
set -g set-titles on
set -g set-titles-string '#{window_index}.#{pane_index} ☞ #{pane_current_command}'
# }}}
# pane-borders {{{
# set -g pane-border-status top
%if "#{!=:$SSH_CONNECTION,}"
%hidden TMUX_PANE_BORDER_STYLE='#{?pane_synchronized,fg=red,fg=blue}'
%hidden TMUX_PANE_ACTIVE_BORDER_STYLE='#{?pane_synchronized,fg=brightred,fg=yellow}'
%else
%hidden TMUX_PANE_BORDER_STYLE='#{?pane_synchronized,fg=red,fg=white}'
%hidden TMUX_PANE_ACTIVE_BORDER_STYLE='#{?pane_synchronized,fg=brightred,fg=green}'
%endif
set -gF pane-border-style "$TMUX_PANE_BORDER_STYLE"
set -gF pane-active-border-style "$TMUX_PANE_ACTIVE_BORDER_STYLE"
set -g pane-border-format "(#{pane_index}) #{pane_title} → #{pane_current_command}"
# }}}
# mode style {{{
setw -g mode-style 'bg=green, fg=black'
# }}}
# status line {{{
setw -g status-style 'bg=black, fg=green'
set -g status-interval 5
set -g status-position bottom
# status right {{{
%hidden TMUX_PANE_HOME_SHORTENED_PATH="#{s|\\$HOME|~|:pane_current_path}" # replace $HOME with ~ in current_path
%hidden PANE_ALL_SHORTENED_PATH="#{s|(/.)[^/]*|\\1|:$TMUX_PANE_HOME_SHORTENED_PATH}" # transform [~]/aaa/bbbb/ccc to [~]/a/b/c
%hidden PANE_CUR_DIR="#{b:pane_current_path}" # get current directory name (e.g. ccc)
%hidden PANE_SHORTENED_PATH="#{s|/[^/]*$|/$PANE_CUR_DIR|:$PANE_ALL_SHORTENED_PATH}" # transform [~]/a/b/c to [~]/a/b/ccc
%hidden PATH_LEN='#(tmux display-message -p "#{T:TMUX_PANE_HOME_SHORTENED_PATH}" |wc -c)' # get number of charactes in path
%hidden PATH_OVERFLOW="#{e|>:$PATH_LEN,#{e|*|f:#{window_width},0.4}}" # check if path len is > 0.4*{window_width}
%hidden SSH_PANE="#{==:#{pane_current_command},ssh}"
##{s|/[^/]*$|#{s|.*(/[^/]*$)|\\1|:pane_current_path}|:#{s|(/.)[^/]*|\\1|:#{s|\\$HOME|~|:pane_current_path}}} "
%hidden PANE_PATH="#{user}@#{host} #{?$PATH_OVERFLOW,$PANE_SHORTENED_PATH,$TMUX_PANE_HOME_SHORTENED_PATH} "
%hidden SSH_PROC="[ssh: #(ps -f --ppid #{pane_pid} | sed -e 's/.*ssh //')]"
set -g status-right "#{?$SSH_PANE,$SSH_PROC,$PANE_PATH} [#(date +'%a %b %d %T')]"
# status left {{{
set -g status-left '#[fg=green, bold]#{pane_mode}#[fg=default,bg=default,none]'
set -ga status-left '#[bold]#{?client_prefix,#[fg=yellow],}[#S]#[fg=default,bg=default,none] '
set -g status-left-length 80
set -g status-right-length 80
# }}}
# }}}
# Windows status {{{
setw -g window-status-activity-style fg=yellow
setw -g window-status-bell-style fg=red
setw -g window-status-format "[#I#F #W]"
setw -g window-status-current-format "[#I#F#[fg=brightgreen bold] #W#[fg=default none]]"
setw -g window-status-separator " "
# setw -g window-status-current-style
# setw -g window-status-style "fg=green"
# setw -g window-status-last-style default
set -g status-justify left
# }}}
# List of plugins {{{
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'jaclu/tmux-menus'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
# }}}
# plugin options {{{
set -g @emulate-scroll-for-no-mouse-alternate-buffer "on"
set -g @scroll-speed-num-lines-per-scroll "1"
set -g @menus_trigger 'C-\'
# }}}
# Key-Bindings {{{
# set -g prefix C-a
# bind C-a send-prefix
unbind '"'
unbind %
# unbind C-b
unbind -T copy-mode-vi y
# tmux controls
bind-key r source-file ~/.tmux.conf \; display-message "tmux reloaded!"
bind-key T command-prompt -p "New pane title:" 'select-pane -T "%%"'
bind-key F2 setw synchronize-panes \; display-message "#{?pane_synchronized,Panes Synchronized,Panes Free}"\; \
set -gF pane-border-style "$TMUX_PANE_BORDER_STYLE"\; \
set -gF pane-active-border-style "$TMUX_PANE_ACTIVE_BORDER_STYLE"
bind-key C-t setw pane-border-status
bind-key @ command-prompt -p "Move pane to (v):" "move-pane -v -t '%%'"
bind-key C-@ command-prompt -p "Move pane to (h):" "move-pane -h -t '%%'"
# Window swapping
bind-key b last-window
bind-key C-p previous-window
bind-key C-n next-window
bind-key Enter popup -E -d "#{pane_current_path}" $SHELL
bind-key M-Enter split-window -v
# Copy mode bindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
# Navigate to previous/next prompt
bind-key -T copy-mode-vi [ send-keys -X start-of-line \; send-keys -X search-backward 'laurenzi@.*?\$'
bind-key -T copy-mode-vi ] send-keys -X start-of-line \; send-keys -X search-forward 'laurenzi@.*?\$'
# }}}
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.tmux/plugins/tpm/'
run '~/.tmux/plugins/tpm/tpm'
# vim:set et sw=4 ts=4 fdm=marker: