-
Notifications
You must be signed in to change notification settings - Fork 6
/
.tmux.conf
169 lines (135 loc) · 5.04 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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
#======================================================================
# .tmux.conf
# Fichero de opciones del tmux
#
# Vicente Gimeno Morales - Electro7
# 31 ago. 2019
#======================================================================
# Basic options
#----------------------------------------------------------------------
# Colors
TMUX_H_FG="brightblue" # Highlight foreground
TMUX_H_BG="default" # Highlight background
# Compatibility with xterm keys
setw -g xterm-keys on
# Renumber windows from 1
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# History limit
set -g history-limit 5000
# Visual-activity
setw -g monitor-activity off
set -g visual-activity off
# Increase vim response
set -sg escape-time 0
# Using the mouse to switch panes
set -g mouse on
# 256 color support
set -g default-terminal "screen-256color"
# tmux messages are displayed for 2 seconds
set -g display-time 2000
# refresh 'status-left' and 'status-right' more often
set -g status-interval 5
# focus events enabled for terminals that support them
set -g focus-events on
# super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
# Remaps and maps
#----------------------------------------------------------------------
# emacs key bindings in tmux command prompt (prefix + :) are better than
# vi keys, even for vim users
set -g status-keys emacs
# Remap ctrl+b to ctr+t
unbind-key C-b
set-option -g prefix C-t
bind-key C-t send-prefix
# Split commands
bind-key h split-window -h
bind-key v split-window -v
unbind-key '"'
unbind-key %
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-Left if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-Down if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-Up if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-Right if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -T copy-mode-vi C-Left select-pane -L
bind-key -T copy-mode-vi C-Down select-pane -D
bind-key -T copy-mode-vi C-Up select-pane -U
bind-key -T copy-mode-vi C-Right select-pane -R
# switch panel usen Ctrl-arrow without prefix
#bind -n C-Left select-pane -L
#bind -n C-Right select-pane -R
#bind -n C-Up select-pane -U
#bind -n C-Down select-pane -D
# Reload config
bind r source-file ~/.tmux.conf \;\
display 'Reloaded tmux config...'
# Copy & Paste
# Start copy mode -> "ctrl+t y"
# Select with "v". Save with "y"
# Exit copy-mode with "q"
# Copy with "ctrl-t p"
# Change select mode a rectangle with "r"
bind-key y copy-mode
bind p paste-buffer
bind-key -T copy-mode Escape send-keys -X cancel
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# Move to panels
bind-key F1 select-pane -t 1
bind-key F2 select-pane -t 2
bind-key F3 select-pane -t 3
bind-key F4 select-pane -t 4
bind-key F5 select-pane -t 5
bind-key F6 select-pane -t 6
bind-key F7 select-pane -t 7
bind-key F8 select-pane -t 8
bind-key F9 select-pane -t 9
#----------------------------------------------------------------------#
# Appareance
#----------------------------------------------------------------------#
#set -g status-left '#[fg=blue,bg=default]#[fg=black,bg=blue] TMUX #S #[fg=blue,bg=default] '
#setw -g window-status-current-format "#[fg=brightblue,bg=default]#[fg=black,bg=brightblue] #I: #W #[fg=brightblue,bg=default]"
# Status line
set -g status on
set -g status-interval 3
set -g status-position top
set -g status-fg white
set -g status-bg default
set -g message-style fg=white
set -g status-left '#[fg=black,bg=blue] TMUX #S #[fg=blue,bg=default]'
set -g status-left-length 20
set -g status-right ' #{client_termname} #T #[fg=black,bg=yellow]#{pane_mode}'
set -g status-right-style fg=$TMUX_H_FG
set -g status-right-length 40
setw -g window-status-separator " "
setw -g window-status-current-format "#[fg=$TMUX_H_FG,bg=$TMUX_H_BG] [#I] #W "
setw -g window-status-format "#[fg=blue] #I: #W "
# Pane borders
set -g pane-border-status top
set -g pane-border-style fg=brightblack,bg=default
set -g pane-active-border-style fg=$TMUX_H_FG,bg=default
set -g pane-border-format \
"#{?pane_active,#[fg=$TMUX_H_FG#,bg=default],#[fg=white,bg=default]} [ #P ] "
#----------------------------------------------------------------------#
# Plugins
#----------------------------------------------------------------------#
# Plugin manager
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# prefix+I : Install new
# prefix+u : Updates
# prefix+alt+u : Remove plugins
set -g @plugin 'tmux-plugins/tpm'
# Save and restore layout
# prefix+ctrl+s : save
# prefix+ctrl+r : restore
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Initialize TMUX plugin manager
#(keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'