-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
161 lines (143 loc) · 7.31 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
# vim: foldlevel=0
#
# _ __
# | |_ _ __ ___ _ ___ __ ___ ___ _ __ / _|
# | __| '_ ` _ \| | | \ \/ / / __/ _ \| '_ \| |_
# | |_| | | | | | |_| |> < _ | (_| (_) | | | | _|
# \__|_| |_| |_|\__,_/_/\_\ (_) \___\___/|_| |_|_|
#
# Jeremy Brubaker's .tmux.conf. Some stuff in here was shame-
# lessly ripped from places I completely forget about.
# Written for tmux >2.3
#
# https://github.com/jbrubake/dotfiles/blob/master/tmux.conf
# Folding cheet sheet (because I always forget)
# zR open all folds
# zM close all folds
# za toggle fold at cursor position
# zj move down to start of next fold
# zk move up to end of previous fold
# Options {{{1
#########
#
# Set options:
# Default is session option
# -g : global
# -w : set-window-option
# -s : server option
# -a : append
# -u : unset and inherit from global option
#
# Tell applications running in tmux what it's capabilities are
# tmux itself still uses the original value of $TERM (your actual terminal)
set-option -g default-terminal tmux-256color
# Turn on 256 color support for various underlying terminals (needed for Vim)
set-option -sa terminal-features ",*256*:RGB"
set-option -sa terminal-features ",alacritty*:RGB"
# Fancy underlines
set-option -ga terminal-features ",*:usstyle"
set-option -g default-command "${SHELL}" # Don't spawn login shells
set-option -g prefix C-s # Change prefix to ^S
set-option -g base-index 1 # Start numbering windows at 1 instead of 0
set-option -g pane-base-index 1 # Start numbering panes at 1 instead of 0
set-option -g visual-activity on # Visual notification on activity
set-option -g set-titles off # Set terminal title
set-option -g set-titles-string "#h" # Titlebar: "<hostname>"
set-option -g mouse on # Mouse can be used in copy mode
set-option -g history-limit 10000 # Lines of scrollback
set-option -g renumber-windows on # Renumber windows after closing a window
set-option -sg escape-time 0 # Respond faster
set-option -wg mode-keys vi # vi copy mode
set-option -wg monitor-activity on # Higlight windows with activity
set-option -wg aggressive-resize on # Always resize windows
set-option -gq @plugin_dir "~/.tmux/" # Location of my plugin framework
# Colors {{{1
########
#
# black, red, green, yellow, blue, magenta, cyan, white
# brightxxx
# colour0 - colour255
# #ffffff
#
set-option -g status-style fg=white,bg=black
set-option -g window-status-style fg=brightblack,bg=black
set-option -g pane-border-style fg=white
set-option -g pane-active-border-style fg=blue
set-option -g message-style fg=black,bg=yellow
# Status Line {{{1
#############
#
set-option -g status 2
set-option -g status-position top
set-option -g status-interval 15 # Update interval (Default = 15)
set-option -g status-left-length 200 # Max length (Default = 10)
set-option -g status-right-length 200 # Max length (Default = 40)
set-option -g status-justify left # Left justify window list
set-option -g window-status-format "#($(tmux show-option -gqv @plugin_dir)/status.sh window '#F')"
set-option -g window-status-current-format "#($(tmux show-option -gqv @plugin_dir)/status.sh window '#F')"
set-option -g status-left "#($(tmux show-option -gqv @plugin_dir)/status.sh left)"
set-option -g status-right "#($(tmux show-option -gqv @plugin_dir)/status.sh right)"
set-option -g status-format[0] "#[align=left range=left #{status-left-style}]#[push-default]#{T;=/#{status-left-length}:status-left}#[nolist align=right range=right #{status-right-style}]#[push-default]#{T;=/#{status-right-length}:status-right}#[pop-default]#[norange default]"
set-option -g status-format[1] "#[pop-default]#[norange default]#[list=on align=centre]#[list=left-marker]<#[list=right-marker]>#[list=on]#{W:#[range=window|#{window_index} #{window-status-style}#{?#{&&:#{window_last_flag},#{!=:#{window-status-last-style},default}}, #{window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{window-status-bell-style},default}}, #{window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{window-status-activity-style},default}}, #{window-status-activity-style},}}]#[push-default]#{T:window-status-format}#[pop-default]#[norange default]#{?window_end_flag,,#{window-status-separator}},#[range=window|#{window_index} list=focus #{?#{!=:#{window-status-current-style},default},#{window-status-current-style},#{window-status-style}}#{?#{&&:#{window_last_flag},#{!=:#{window-status-last-style},default}}, #{window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{window-status-bell-style},default}}, #{window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{window-status-activity-style},default}}, #{window-status-activity-style},}}]#[push-default]#{T:window-status-current-format}#[pop-default]#[norange list=on default]#{?window_end_flag,,#{window-status-separator}}}"
# Key Bindings {{{1
##############
#
# Bind options:
# -t <cmd table> : Binding applies to <cmd table>
# -r : key may repeat (see repeat-time option)
#
bind-key C-s send-prefix # ^s^s sends a literal ^s
bind-key S choose-session # Default 's'
bind-key s split-window -v -c "#{pane_current_path}" # Split top/bottom
bind-key v split-window -h -c "#{pane_current_path}" # Split right/left
bind-key \" split-window -v -c "#{pane_current_path}" # Split top/bottom
bind-key % split-window -h -c "#{pane_current_path}" # Split right/left
# Resize panes using hjkl
#
bind-key -r h resize-pane -L
bind-key -r j resize-pane -D
bind-key -r k resize-pane -U
bind-key -r l resize-pane -R
# tmux pilot
#
PILOT_ROOT=$HOME/.vim/pack/minpac/start/vim-tmux-pilot
if-shell '[ -r $PILOT_ROOT/pilot.tmux ]' {
source-file $PILOT_ROOT/pilot.tmux
# Use Alt+[hjkl] to navigate between panes
#
PILOT_KEY_H='M-h'
PILOT_KEY_J='M-j'
PILOT_KEY_K='M-k'
PILOT_KEY_L='M-l'
PILOT_KEY_P='M-\'
}
# Reload .tmux.conf
bind-key r source-file ~/.tmux.conf \; display "Reloaded!"
# Copy mode
#
# <prefix>C-c: enter copy mode
# v: begin selection
# V: begin line-wise selection
# y, Enter: copy to X11 clipboard
# Mouse: select and copy to X11 clipboard
# r: Toggle rectangle selection mode
bind-key C-c copy-mode -e
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -T copy-mode-vi Enter send-keys y
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# Shift + Page{Up,Down} works as expected
#
bind-key -T root S-PageUp copy-mode -eu
bind-key -T root S-PageDown send-keys PageDown
# Default Bindings {{{1
##################
#
#bind-key ! break-pane # Make current pane its own window
#bind-key break-pane -d # Make current pane its own window but don't switch to it
#bind-key join-pane -s :! # Split current pane and move prev pane in prev window into split
#bind-key , rename-window
#bind-key rename-session
#bind-key C-o rotate-window