-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
172 lines (140 loc) · 4.5 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
168
169
170
171
172
# Supports native Tmux key bindings
# , - rename window
# $ - rename session
# x - kill pane
# & - kill window
# f - find window
# ! - break pane into window
# w - choose-window
# Backtick as Prefix
set -g prefix `
# Panes
# Split aside
bind | split-window -h
bind \ split-window -h
# Split below
bind - split-window -v
bind _ split-window -v
# Show status line at top instead of bottom
set -g status-position top
# Center window names
set -g status-justify centre
# Semi-colon to Command
bind \; command-prompt
# Status line colors
# Cyan on Black instead of Black on Green
set -g status-bg black
set -g status-fg cyan
# Reload configuration file
bind r source-file ~/.tmux.conf \; display "Reloaded !"
# Clock mode
# Activated by t
# Show AM/PM instead of 24 hours
setw -g clock-mode-style 12
# Show time in green instead of blue
setw -g clock-mode-colour green
# Window navigation
bind ] next-window
bind [ previous-window
# Rotate window right/left
bind } swap-window -t +1
bind { swap-window -t -1
# Show session name, window and pane number, and date and time on the left side of status line
set -g status-right "#[fg=green,bold] %l#[fg=green,none]:%M %p #[fg=yellow,underscore]%a#[fg=yellow,none], #[fg=yellow,none]%b #[fg=yellow,bold]%d " # %Y
# Session, window, and pane number
set -g status-left "#[fg=green]#S #[fg=yellow,bold]#I #[fg=cyan,none]#P"
# Window name colors on status line
set -g window-status-style fg=cyan
# Color active window name on status line
# Appended by star eg. 1:.fish*
set -g window-status-current-style fg=yellow,bold
# Last window before switching to the current
# Appended by dash, eg. 2:.tmux.conf-
set -g window-status-last-style fg=cyan,underscore
# Remove clutter from window names
# Such as numbers, colons, stars, and dashes
# Status indication by color and underscore
setw -g window-status-current-format '#W'
setw -g window-status-format '#W'
# Rename window according to what's being running in it
setw -g automatic-rename on
# Renumber if windows are dropped
set -g renumber-windows on
# Window numbers start from one instead of zero
# Use Prefix + Number to switch to specific window
set -g base-index 1
# Pane numbers start from one instead of zero
# As displayed by Prefix + q
set -g pane-base-index 1
# Lengthy status line for the left side
set -g status-left-length 70
# Pane selection, resizing and swap
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
bind -r C-k swapp -U
bind -r C-j swapp -U
bind -r C-h swapp -D
bind -r C-l swapp -D
# Switch to the last window
# Default was Prefix+l
# Resetting to 0, since window indexing starts from 1
# Same as selectw -l
# Shorthand last
bind -r 0 last-window
# Copy mode
# Press v to enter the mode
bind -r v copy-mode
# Press v in Copy Mode to start selecting text
bind -t vi-copy 'v' begin-selection
# Visual Block Mode
# Press SPC or v right after
bind-key -t vi-copy 'C-v' rectangle-toggle
# Press y to copy the selection and exit the mode
bind -t vi-copy 'y' copy-pipe 'xclip -in -selection primary'
bind -t vi-copy 'Y' copy-selection
# Vi Mode for command line
set -g status-keys vi
# ?
setw -g mode-keys vi
# Copy Mode style
setw -g mode-style "fg=black,bold bg=yellow"
# Message colors
setw -g message-style "fg=white bg=black"
# Normal mode in command line (when Vi Mode is enabled)
setw -g message-command-style "fg=cyan bg=black"
# Unicode and terminal colors
# Provided by default in newer versions
# setw -g utf8 on
# set -g status-utf8 on
set -g default-terminal "screen-256color"
# Confirmation-less closing
# confirm-before -p "kill-window #W? (y/n)" kill-window
# tmux list-keys | grep confirm-before
bind & kill-window
# Kills window too when window has only one pane
bind x kill-pane
# Toggle status bar.
bind 'b' set-option status
# Input command name to bring up manual page at top
# Command prompt supports ^u to delete until beginning of line
bind 'C' command-prompt "split-window -b 'exec man %%'"
# Enable mouse on Tmux
set -g mouse on
# Legacy
# setw -g mode-mouse on
# # Select windows by clicking on their names in the status line or scrolling with wheel over their names
# setw -g mouse-select-window on
# # Select panes by clicking on them
# set -g mouse-select-pane on
# # Resize panes with mouse by dragging their borders
# set -g mouse-resize-pane on
# inactive pane border color
set -g pane-border-fg magenta #purple
# active pane border color
set -g pane-active-border-fg cyan