-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.tmux.conf
More file actions
80 lines (55 loc) · 2.94 KB
/
.tmux.conf
File metadata and controls
80 lines (55 loc) · 2.94 KB
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
setw -g mode-keys vi
set -g xterm-keys on
# Unbind default next/previous window keys to avoid conflicts (optional but recommended)
unbind n
unbind p
# -n here basically means no prefix required
bind-key -n M-d next-window # This means: Alt + Shift + d -> next window
bind-key -n M-a previous-window # This means: Alt + Shift + a -> previous window
bind-key -n M-0 select-window -t :0 # This means: Alt + Shift + 0 -> select window 0
bind-key -n M-1 select-window -t :1 # This means: Alt + Shift + 1 -> select window 1
bind-key -n M-2 select-window -t :2 # This means: Alt + Shift + 2 -> select window 2
bind-key -n M-3 select-window -t :3 # This means: Alt + Shift + 3 -> select window 3
bind-key -n M-4 select-window -t :4 # This means: Alt + Shift + 4 -> select window 4
bind-key -n M-5 select-window -t :5 # This means: Alt + Shift + 5 -> select window 5
bind-key -n M-6 select-window -t :6 # This means: Alt + Shift + 6 -> select window 6
bind-key -n M-7 select-window -t :7 # This means: Alt + Shift + 7 -> select window 7
bind-key -n M-8 select-window -t :8 # This means: Alt + Shift + 8 -> select window 8
bind-key -n M-9 select-window -t :9 # This means: Alt + Shift + 9 -> select window 9
# Start windows with 1 instead of 0
set -g base-index 1
# Enable mouse
set -g mouse on
# Open a new window with Alt+Enter
bind-key -n M-Enter new-window -c "#{pane_current_path}"
# Detach from session with Ctrl+Alt+d
bind-key -n C-M-d detach
# Bind Alt+Esc to enter copy mode
bind-key -n M-Escape copy-mode
# Bind 'v' to begin a character-wise selection (like Vim's 'v')
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
# Bind 'V' to begin a line-wise selection (like Vim's 'V')
bind-key -T copy-mode-vi 'V' send-keys -X select-line
# Bind 'C-v' for rectangular selection (like Vim's 'Ctrl+v')
# Note: 'rectangle-toggle' is for older tmux versions. 'begin-selection' is more standard now
# and subsequent horizontal/vertical movement after C-v will achieve block.
# However, for explicit block selection in newer tmux, you might use 'rectangle-toggle'
# or a combination. The behavior of C-v can be tricky across versions.
# Let's use the most common one for newer versions:
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
# Or, if rectangle-toggle doesn't work as expected, you might use:
# bind-key -T copy-mode-vi C-v send-keys -X begin-selection # Then move for block
# To copy the selection (yank) with 'y' (like Vim's 'y')
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection-and-cancel
# For pasting with 'p' (optional, as prefix + ] is default)
# bind-key -T copy-mode-vi 'p' send-keys -X paste-buffer
set -g history-limit 10000 # Example: set to 50,000 lines
# vertical split
bind -n M-h split-window -h -c "#{pane_current_path}"
# horizontal split
bind -n M-v split-window -v -c "#{pane_current_path}"
# Pane navigation with Alt+Shift+WASD
bind -n M-A select-pane -L
bind -n M-D select-pane -R
bind -n M-W select-pane -U
bind -n M-S select-pane -D