-
Notifications
You must be signed in to change notification settings - Fork 7
/
.tmux.conf
executable file
·104 lines (82 loc) · 3.49 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
# Remap prefix
unbind C-b
set -g prefix C-Space
# Ensure split windows get the same path as the current window's path
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Quick key for moving back to the previous window
bind-key L last-window
# Vim style bindings for pane movement
bind-key -r h select-pane -L
bind-key -r j select-pane -D
bind-key -r k select-pane -U
bind-key -r l select-pane -R
# Fix issue with tmux repeating -r the arrow directions (meaning when you switch panes you can accidentally jump back to the other pane again)
bind-key Up select-pane -U
bind-key Down select-pane -D
bind-key Left select-pane -L
bind-key Right select-pane -R
# Make resizing panes easier
bind-key < resize-pane -L 5
bind-key > resize-pane -R 5
bind-key + resize-pane -D 5
bind-key - resize-pane -U 5
bind-key = select-layout even-vertical
bind-key | select-layout even-horizontal
bind-key v select-layout main-vertical
bind-key h select-layout main-horizontal
bind-key t select-layout tiled
# Reload tmux config
bind-key r source-file ~/.tmux.conf
# Neovim suggested adding this otherwise its 'autoread' option might not work.
set-option -g focus-events on
# Ensure terminal color palette is working.
#
# NOTE: We don't use screen-256color because if we did the tmux background
# wouldn't be transparent and pick up the terminal's theme. It's important to
# have the transparent background otherwise some vim themes will otherwise break.
# The fix is to append -bce to the value to get a transparent tmux background.
#
# NOTE: ~/.zshrc needs to set `export TERM=xterm-256color`.
#
set-option -g default-terminal 'screen-256color-bce'
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Enable UTF8 support (should be default setting now)
# set-window-option -g utf8 on
# Use Vi style key bindings to move around copy mode
setw -g mode-keys vi
# Make sure messages (using display-message) are displayed for long enough to read
set-option -g display-time 5000
# Remove delay when pressing esc in Vim
set-option -sg escape-time 0
# Fix issue with copying from within a tmux session and wanting to paste outside of it
# Changed from /bin/zsh to Homebrew zsh install /usr/local/bin/zsh
set-option -g default-command "reattach-to-user-namespace -l '/opt/homebrew/bin/zsh'"
# Ensure tmux gets your Homebrew zsh install
set-option -g default-shell /opt/homebrew/bin/zsh
# Setup `v` and `y` operators to start and yank selections (like Vim)
#
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"
# Prevent tmux from renaming the tab when processes change
set-option -g allow-rename off
# Set base index value to one (as apposed to zero)
set-option -g base-index 1
# Increase scrollback lines
set-option -g history-limit 30000
# Renumber windows automatically after removing a window
# Prevents my OCD and means I don't have to manually run {move|swap}-window
set-option -g renumber-windows on
# Set status bar background colour
#
# NOTE: Check all current settings run `tmux show-options -g | grep status`.
set-option -g status-bg yellow
set-option -g status-right "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,} %H:%M %d-%b-%y"
# Configure the current window
#
set-window-option -g window-status-current-style bg=brightred,fg=white
# Plugins
set-option -g @plugin 'tmux-plugins/tpm'
set-option -g @plugin 'tmux-plugins/tmux-resurrect'
run '~/.tmux/plugins/tpm/tpm'