-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
161 lines (122 loc) · 5.06 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
unbind r
bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!"
set -g terminal-overrides 'xterm*:Tc'
set -g default-terminal "xterm-256color"
# Set the prefix to `ctrl + space` instead of `ctrl + b`
unbind C-b
set -g prefix C-Space
bind-key C-Space send-prefix
bind-key b set-option -g status off
bind-key B set-option -g status on
set -sa terminal-overrides ".xterm*:Tc"
set -g mouse on
bind-key -n M-H previous-window
bind-key -n M-L next-window
# Binds backtick character to switch to marked pane with prefix + m
bind \` switch-client -t'{marked}'
# Better split pane keybindings
bind-key '\' split-window -h
bind-key "-" split-window -v -c "#{pane_current_path}"
bind-key "_" split-window -fv -c "#{pane_current_path}"
unbind '"'
# StatusBar Position
set-option -g status-position top
#swap windows around
bind -r "<" swap-window -d -t -1
bind -r ">" swap-window -d -t +1
# Set window and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g renumber-windows on
# Keep current path in newly created windows
bind c new-window -c "#{pane_current_path}"
# Pane Resizing: Prefix + Ctrl-h/j/k/l
bind -r C-j resize-pane -D 5
bind -r C-k resize-pane -U 5
bind -r C-h resize-pane -L 5
bind -r C-l resize-pane -R 5
# Open panes in current directory
bind-key '"' split-window -v -c "#{pane_current_path}"
bind-key % split-window -h -c "#{pane_current_path}"
# act like vim
setw -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Setup 'y' to yank (copy), just like Vim
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi 'V' send -X select-line
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
#############################
########## Settings
#############################
# Refresh status line every 5 seconds - Good for when music is playing / update time etc
set -g status-interval 5
# Start window and pane indices at 1.
set -g base-index 1
set -g pane-base-index 0
# Length of tmux status line
set -g status-left-length 30
set -g status-right-length 150
set-option -g status "on"
# Default statusbar color
set-option -g status-style bg=default,fg=colour255 # bg=bg1, fg=fg1
# Default window title colors
set-window-option -g window-status-style bg=colour214,fg=colour16 # bg=yellow, fg=bg1
# Default window with an activity alert
set-window-option -g window-status-activity-style bg=colour117,fg=colour255 # bg=bg1, fg=fg3
# Active window title colors
set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
# Set active pane border color
set-option -g pane-active-border-style fg=colour214
# Set inactive pane border color
set-option -g pane-border-style fg=colour255
# Message info
set-option -g message-style bg=default,fg=colour207 # bg=bg2, fg=fg1
# Writing commands inactive
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
# Pane number display
set-option -g display-panes-active-colour colour1 #fg2
set-option -g display-panes-colour colour255 #bg1
# Clock
set-window-option -g clock-mode-colour colour109
# Bell
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
set-option -g status-left "\
#[fg=colour241, bg=default]#{?client_prefix,#[fg=colour167],}#{?window_zoomed_flag, 🔍,❄️⛄🌙 }"
set-option -g status-right "\
#[fg=colour27,bg=default] \
#[fg=colour39,bg=default] #(~/.config/tmux/scripts/weather.sh) \
#[fg=colour39,bg=default] #(~/.config/tmux/scripts/uptime.sh)"
#[fg=colour37,bg=default] %b %d '%y
set-window-option -g window-status-current-format "\
#[fg=colour0, bg=colour0]\
#[fg=colour255, bg=colour0] #I* \
#[fg=colour255, bg=colour0, bold] #W \
#[fg=colour0, bg=colour0] "
set-window-option -g window-status-format "\
#[fg=colour236,bg=colour236,noitalics]\
#[fg=colour16,bg=colour236] #I \
#[fg=colour16, bg=colour236] #W \
#[fg=colour236, bg=colour236]"
# Set the history limit so we get lots of scrollback.
setw -g history-limit 50000000
# 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-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l