-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
114 lines (88 loc) · 3.67 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
# Ring the bell if any background window rang a bell
set -g bell-action any
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color
set-option -sa terminal-overrides ',alacritty*:Tc,xterm-256color*:Tc'
# do not auto rename
set-option -g allow-rename off
# enable mouse mode
set -g mouse on
# enable focus events
set -g focus-events on
# Keep your finger on ctrl, or don't
bind-key ^D detach-client
# Create splits and vertical splits
bind-key | split-window -h -l 50% -c "#{pane_current_path}"
bind-key ^V split-window -h -l 50% -c "#{pane_current_path}"
bind-key - split-window -l 50% -c "#{pane_current_path}"
bind-key ^S split-window -l 50% -c "#{pane_current_path}"
# Pane resize in all four directions using vi bindings.
# Can use these raw but I map them to shift-ctrl-<h,j,k,l> in iTerm.
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Use vi keybindings in copy and choice modes
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# set first window to index 1 (not 0) to map more to the keyboard layout...
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Patch for OS X pbpaste and pbcopy under tmux.
if-shell '[ $(uname) -eq "Darwin" ]' \
'set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL" ' \
'bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -se c -i"'
# No escape time for vi mode
set -sg escape-time 0
# Bigger history
set -g history-limit 10000
# New windows/pane in $PWD
bind c new-window -c "#{pane_current_path}"
# Fix key bindings broken in tmux 2.1
set -g assume-paste-time 0
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Local config
if-shell "[ -f ~/.tmux.conf.user ]" 'source ~/.tmux.conf.user'
bind j select-pane -D
bind k select-pane -U
bind h select-pane -L
bind l select-pane -R
set-option -g renumber-windows on
set-option -g status "on"
# From alacritty settings
set -g @black '#090618'
set -g @red '#c34043'
set -g @green '#76946a'
set -g @yellow '#c0a36e'
set -g @blue: '#7e9cd8'
set -g @magenta: '#957fb8'
set -g @white '#c8c093'
set -g @cyan '#6a9589'
set -g @white '#c8c093'
set -g @gray '#2a2a37'
set -g @dark_gray '#1a1a22'
set -g @light_purple '#363646'
set -g @dark_purple '#54546D'
set -g @orange '#dca561'
# statusbar
set -g status-style "bg=#{@gray},fg=#{@white}"
set -g status-justify "left"
set -g status-right-length 120
# pane border
set -g pane-border-style fg="#{@gray}"
set -g pane-active-border-style fg="#{@dark_purple}"
# message infos
set -g message-style bg="#{@gray}",fg="#{@white}"
## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
set-option -g status-left "#[fg=#{@dark_gray},bg=#{@green},bold] #S "
set-option -g status-right "#[fg=#{@dark_gray},bg=#{@cyan}] #(kubectl config current-context) #[fg=#{@dark_gray},bg=#{@green}] %Y-%m-%d %H:%M #[fg=#{@dark_gray},bg=#{@orange}] #H "
set-window-option -g window-status-current-format "#[fg=#{@dark_gray},bg=#{@cyan}] #I#{?window_zoomed_flag,\*Z,} #[fg=#{@dark_gray},bg=#{@cyan},bold]#W "
set-window-option -g window-status-format "#[fg=#{@white},bg=#{@gray}] #I#{?window_zoomed_flag,\*Z,} #W "