-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
executable file
·76 lines (57 loc) · 2.48 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
# Smart pane switching with awareness of vim splits
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"
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
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# New splits open in current directory
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Use Vim key bindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-selection
# No Esc key delay
set -s escape-time 0
# Mouse support - set to on if you want to use the mouse
set -g mouse on
# Set the default terminal mode to 256color mode
# set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ",*alacritty*:Tc"
set-option -sa terminal-overrides ',*256col*:Tc'
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# Center the window list
set -g status-justify centre
# Start windows and panes at 1, not 0
setw -g base-index 1
setw -g pane-base-index 1
# Highlight current pane
set-option -g pane-active-border-style bg=blue,fg=default
# Open a new window, prompt for a hostname, and ssh to it
bind-key S command-prompt -p ssh: "new-window -n %1 'ssh %1'"
# List all panes in all windows
bind-key h choose-tree
# Pair program, but don't shrink my window if you're not paying attention!
setw -g aggressive-resize on
# Undercurl
set -g default-terminal "${TERM}"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours
if-shell "type 'reattach-to-user-namespace' >/dev/null" "source ~/.tmux-osx.conf"