-
Notifications
You must be signed in to change notification settings - Fork 3
/
.tmux.conf
149 lines (128 loc) · 5.37 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
##################################
#
# TMUX SETTINGS
#
# REFERENCES:
# man tmux (seriously, do it before checking any of the links below)
# http://lukaszwrobel.pl/blog/tmux-tutorial-split-terminal-windows-easily
# https://gist.github.com/spicycode/1229612
# https://gist.github.com/Bekbolatov/6840069e51382965fdad
# http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# https://superuser.com/questions/285381/how-does-the-tmux-color-palette-work
# https://mutelight.org/practical-tmux
# https://github.com/nicknisi/vim-workshop
# https://github.com/changemewtf/dotfiles
# https://build-podcast.com/tmux/
# https://coderwall.com/t/tmux/popular
# https://github.com/gpakosz/.tmux
# http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting/
# https://blauaraujo.com/configuracoes-basicas-do-tmux/
# https://arcolinux.com/everything-you-need-to-know-about-tmux-status-bar/
#
##################################
# Deactivating Ctrl-b and using Ctrl-a as prefix (AKA making the world a better
# place =P)
unbind C-b
set -g prefix C-a
# No delay for escape key press
set -sg escape-time 0
# Set default terminal. Used in combination with the contents from ./.terminfo
set -g default-terminal "xterm-256color"
# Helps enabling italics.
set -as terminal-overrides ',xterm-256color:Tc'
# Message time - only for dotfiles
# Sessions named "dotfiles" will display messages a little bit longer than the
# others. This is REALLY helpful when debugging commands and keybindings.
if-shell -b "checkDotfilesSession" \
"tmux set -t dotfiles display-time 4000"
# Windows indexes ALWAYS start at zero
set -g base-index 0
# Panels indexes ALWAYS start at zero
setw -g pane-base-index 0
# Reindex windows
# Every time a window is created/destroyed, the indexes will be sorted again.
set -g renumber-windows on
# Tip from https://github.com/nicknisi/vim-workshop:
#
# "Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable."
setw -g aggressive-resize on
# Commands history
set -g history-limit 9000000
# Switching between panels using Alt+arrow
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
# Automatically set window title
setw -g automatic-rename on
set -g set-titles on
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# Mode-keys
setw -g mode-keys vi
# Unbinding previous bind
unbind-key -T copy-mode-vi v
# Begin selection in copy mode
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-selection
bind-key -T copy-mode-vi r send -X rectangle-toggle
# Copy from tmux to system buffer
bind -T copy-mode-vi y send -X copy-pipe "xclip -sel clip -i"
# Switching between windows using Shift+arrow
bind -n S-Left previous-window
bind -n S-Right next-window
# Reload tmux settings (~/.tmux.config file) using <prefix>-r
bind r \
source-file ~/.tmux.conf\;\
display "Neo says: I know Kung Fu!"
# Toggle synchronized panes at the current window using <prefix>-P
bind P \
setw synchronize-panes\;\
display "Synced Panes are #{?pane_synchronized,on,off}, Captain!"
# Move current window to the given position index using <prefix>-w
bind w command-prompt "swap-window -t '%%'"
# Shortcut to clear screen and history
bind -n C-l send-keys C-l \;\
run 'sleep 0.1' \;\
clear-history \;\
display "All clear!"
# Theme: Clock
setw -g clock-mode-colour colour155
setw -g clock-mode-style 24
# Theme: Status Bar
set -g status on
set -g status-keys vi
set -g status-justify left
set -g status-position bottom
set -g status-interval 1
set -g status-style bg=colour235,fg=colour6
set -g status-left-length 60
set -g status-left '#[bg=colour196]#[fg=colour220,bold] ☭ TMUX ☭ #[bg=colour237]#[fg=colour99] ( W #[fg=white]#I#[fg=colour99] P #[fg=white]#P #[fg=colour99]) '
set -g status-right-length 60
set -g status-right '#[bg=colour237]#[fg=colour48,bold,italics] #(cd #{pane_current_path}; git rev-parse --abbrev-ref HEAD) #[bg=colour239]#[fg=colour231,bold,italics] #(whoami)#[fg=colour155]@#[fg=colour51]#S #[fg=colour231,noitalics]#[bg=colour240] #(date +"%T") '
# Theme: Windows
setw -g window-status-separator ""
setw -g allow-rename off
setw -g window-status-format " #I:#{?window_flags,#{window_flags},}#W "
setw -g window-status-current-format " #I:#{?window_flags,#{window_flags},}#W "
# Theme: Messages
set -g message-style bg=colour239,fg=colour191
set -g message-command-style bg=colour237,fg=colour33
# Theme: Panes
set -g pane-border-style bg=terminal,fg=colour235
set -g pane-active-border-style bg=terminal,fg=colour196,dotted-underscore
set -g display-panes-active-colour colour196
set -g display-panes-colour colour235
set -g display-panes-time 1
# Theme: Window mode
setw -g mode-style bg=colour33,fg=colour235
# Theme: current Window mode
setw -g window-status-current-style bg=colour236,fg=colour156,bold
setw -g window-status-current-format '[#I: #W]'
# Theme: Window status
setw -g window-status-style bg=colour235,fg=colour239
setw -g window-status-activity-style bg=colour239,fg=colour235,bold
bind W run 'tmux choose-tree -s -O index -F"#[fg=colour9]#{?pane_format,#[fg=colour11]#{pane_current_command} #[fg=colour172]#{pane_title},#{?window_format,#[fg=colour40]#{window_name}#{window_flags},}}"'