-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.linux.conf
167 lines (132 loc) · 4.52 KB
/
tmux.linux.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
# Set the default terminal mode to 256color mode
# set -ga default-terminal "screen-256color"
set -ga terminal-overrides "xterm-256color:Tc"
# set -g status-utf8 on
# set -g utf8 on
set -g status-style "bg=colour238"
set -g pane-active-border-style "fg=colour226"
set -g escape-time 20
# this is the defualt repeat-time (a lower value
# it makes it harder to resize with repeated Alt+Arrow after prefix)
set -g repeat-time 500
set -g set-clipboard off
set -g base-index 1
setw -g pane-base-index 1
# don't allow rename of the window
set-option -g allow-rename off
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# Center the window list
set -g status-justify centre
# Set the vi keys in copy mode
setw -g mode-keys vi
unbind [
bind Escape copy-mode
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
# paste as p
unbind p
bind p run "cat /dev/clipboard | tmux load-buffer - ; tmux paste-buffer"
# copy as y
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -sel clip-board'
# the PREFIX + r reloads the conf
bind r source-file ~/.tmux.conf \; \
display-message "source-file done"
# Change the default PREFIX (CTRL+B) to another key
set-option -g prefix C-a
unbind C-b
bind C-a send-prefix
bind b send-prefix
# quick pane cycling
# bind ^A select-pane -t :.+
unbind ^A
# alternates between last-pane
bind ^A last-pane
bind Space last-pane \; resize-pane -Z
# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# pane movement
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n 'C-\' if-shell "$is_vim" "send-keys 'C-\\'" "select-pane -l"
# 2017/02/10 11:24:25, AA:
# # move between windows
bind C-h previous-window
bind C-l next-window
bind C-p run-shell "pmset displaysleepnow"
set-environment -g CHERE_INVOKING 1
# / parte na "minha" vertical, ficamos com um Left e um Right
bind / split-window -h -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# - parte na "minha" horizontal, ficamos com um Up e um Down
bind - split-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
# 2016/03/30 16:30:55, AA:
unbind n
bind n new-window -c "#{pane_current_path}"
# NOTE: bind -n => it doesn't need the tmux leader
# Clear the screen, like clear
bind '\' "send-keys 'C-l' \; clear-history"
###########################################################################
# Mouse mode
# 2015/10/27 09:52:59, AA:
# Update tmux
# set -g mode-mouse on
# set -g mouse-resize-pane on
# set -g mouse-select-pane on
# set -g mouse-select-window on
set -g mouse on
# set -g mouse-utf8 on
# Toggle mouse on
# 2015/10/27 09:52:59, AA:
# Update tmux
# set -g mode-mouse on \;\
# set -g mouse-resize-pane on \;\
# set -g mouse-select-pane on \;\
# set -g mouse-select-window on \;\
bind m \
set -g mouse on \;\
#set -g mouse-utf8 on \;\
display 'Mouse: ON'
# Toggle mouse off
# 2015/10/27 09:52:59, AA:
# Update tmux
# set -g mode-mouse off \;\
# set -g mouse-resize-pane off \;\
# set -g mouse-select-pane off \;\
# set -g mouse-select-window off \;\
bind M \
set -g mouse off \;\
#set -g mouse-utf8 off \;\
display 'Mouse: 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 @plugin 'tmux-plugins/tmux-copycat'
set -g @copycat_search '?'
set -g @copycat_git_special 'C-s'
set -g @copycat_hash_search 'C-g'
set -g @plugin 'jimeh/tmux-themepack'
set -g @themepack 'block/yellow'
set -g @plugin 'tmux-plugins/tmux-urlview'
# No automatic saving
# set -g @continuum-save-interval '0'
# set -g @continuum-restore 'on'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'