-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
109 lines (89 loc) · 3.56 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
# Prevent ~1 delay after pressing ESC. For better vim usage.
set -sg escape-time 0
# use mouse for scrolling
set -g mouse on
# Aesthetics
set -g default-terminal "alacritty"
set -ga terminal-overrides ",alacritty:Tc"
# Use C-space (control and space key at the same time) as the prefix key
unbind C-b
set -g prefix C-space
# NOTE: you can use vars with $<var> and ${<var>} as long as the str
# is double quoted: ""
# WARNING: hex colors can't contain capital letters
# --> Catppuccin
thm_bg="#1e1d2f"
thm_fg="#dadae8"
thm_cyan="#c2e7f0"
thm_black="#15121c"
thm_gray="#332e41"
thm_magenta="#c6aae8"
thm_pink="#e5b4e2"
thm_red="#e38c8f"
thm_green="#b1e3ad"
thm_yellow="#ebddaa"
thm_blue="#a4b9ef"
thm_orange="#f9c096"
thm_black4="#575268"
set -g pane-border-style bg="$thm_bg",fg="$thm_black4"
set -g pane-active-border-style bg="$thm_bg",fg="$thm_black4"
set -g status-style bg="$thm_bg",fg="$thm_fg"
set -g status-left "#S"
set -g status-left-style fg="$thm_black4"
set -g status-left-length 40
set -g status-right ""
set -g window-status-style bg="$thm_bg",fg="$thm_fg"
set -g window-status-format ' #{pane_current_command} '
set -g window-status-current-style bg="$thm_bg",fg="$thm_blue"
set -g window-status-current-format ' #{pane_current_command} '
set -wg mode-style bg="$thm_blue",fg="$thm_black"
set -g message-style bg="$thm_bg",fg="$thm_magenta"
set -g message-command-style bg="$thm_bg",fg="$thm_yellow"
set -g clock-mode-colour "$thm_blue"
set -g status-justify absolute-centre
# Copy Mode: Enable incremental searching
bind-key -T copy-mode-vi / command-prompt -i -p "search down" "send -X search-forward-incremental \"%%%\""
bind-key -T copy-mode-vi ? command-prompt -i -p "search up" "send -X search-backward-incremental \"%%%\""
# Open new windows and splits in current pane's directory
bind '"' sp -c "$SESSION_DIR"
bind % sp -h -c "$SESSION_DIR"
bind c new-window -c "$SESSION_DIR"
# IDE-like 30% split underneath 70% (which is typically nvim)
bind '_' sp -c "$SESSION_DIR" -p 30
# Choose by "pane" rather than the default, C-w, which
# chooses by window
bind-key j choose-tree
# Start window numbering from 1
set -g base-index 1
# Maintain window indices. E.g. if you have windows (1, 2, 3), then delete
# 2, 3 will be moved to 2, giving (1, 2)
set-option -g renumber-windows on
# Swap window with left/right neighbor and follow focus
bind-key N swap-window -t +1\; select-window -t +1
bind-key P swap-window -t -1\; select-window -t -1
# Kill current session & switch to the next one, if one exists
bind-key K run-shell 'tmux switch-client -n && tmux kill-session -t "$(tmux display-message -p "#S")" || tmux kill-session'
# Break pane into new session
bind-key B send-keys 't && exit' Enter
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# *Without* needing to use the prefix key (via "-n" option) #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Use Ctrl+{h,j,k,l} to switch to the left, down, up, right pane
bind-key -n C-h select-pane -L
bind-key -n C-j select-pane -D
bind-key -n C-k select-pane -U
bind-key -n C-l select-pane -R
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
# Fine adjustment (1 or 2 cursor cells per bump)
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
# Coarse adjustment (5 or 10 cursor cells per bump)
bind -n C-Left resize-pane -L 10
bind -n C-Right resize-pane -R 10
bind -n C-Down resize-pane -D 5
bind -n C-Up resize-pane -U 5