-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.tmux.conf
More file actions
85 lines (70 loc) · 2.76 KB
/
Copy path.tmux.conf
File metadata and controls
85 lines (70 loc) · 2.76 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
81
82
83
84
85
# https://www.youtube.com/watch?v=H70lULWJeig
unbind r
bind r source-file ~/.tmux.conf
set-option -g renumber-windows on
if-shell "[ -f /opt/homebrew/bin/fish ]" \
'set-option -g default-shell /opt/homebrew/bin/fish' \
'set-option -g default-shell /usr/local/bin/fish'
set -g prefix C-Space
setw -g mode-keys vi
# Preserve modifiers for keys like Alt-Enter, Shift-Enter, and Ctrl-Enter so
# terminal TUIs such as Codex can distinguish them from plain Enter.
set -s extended-keys on
set -s extended-keys-format csi-u
set -as terminal-features ',xterm-ghostty:extkeys,alacritty:extkeys,xterm-kitty:extkeys'
# act like vim
# bind-key h select-pane -L
# bind-key j select-pane -D
# bind-key k select-pane -U
# bind-key l select-pane -R
# Easier key presses so you don't have to take
# your findger off ctrl
# Make it so i can also press
# eg. prefix + ctrl-n to switch to next window
# and prefix + ctrl-p to switch to previous window
bind-key C-n next-window
bind-key C-o select-pane -t :.+
bind-key C-space next-layout
bind-key C-p previous-window
bind-key C-c new-window -c "#{pane_current_path}"
# Show sessions
bind-key C-s choose-session
bind-key C-w kill-window
bind-key O kill-window -a
bind-key & kill-window
bind-key C-, copy-mode
bind-key C-r send-keys -t :.+ "r" Enter
# No confirmation on kill-window
bind-key x kill-pane
bind-key C-x kill-pane
bind-key C-v kill-pane
bind-key C-e select-pane -t :.+
bind-key l last-window
bind-key e select-window -t :-
# Save the scrollback buffer
# https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file
bind-key C-f 'capture-pane -S -32768 ; save-buffer /tmp/tmux.history ; delete-buffer ; new-window "chomper /tmp/tmux.history; hx +9999 /tmp/tmux.history"'
# bind-key P run-shell 'tmux capture-pane -S -32768 \; save-buffer /tmp/tmux.history \; delete-buffer \; split-window -h "nvim /tmp/tmux.history"'
# Currently tmux intercepts C-9, C-0 and C-[
# This fix doesn't work
# bind -n C-9 send-keys C-9
# bind -n C-0 send-keys C-0
# https://gist.github.com/william8th/faf23d311fc842be698a1d80737d9631?permalink_comment_id=4260131#gistcomment-4260131
bind-key | split-window -h -c "#{pane_current_path}"
bind-key C-d split-window -h -c "#{pane_current_path}"
bind-key 'C-\' split-window -v -c "#{pane_current_path}"
# bind-key Enter resize-pane -Z
bind-key Enter copy-mode
bind-key C-m copy-mode
bind-key C-Enter copy-mode
bind-key \\ split-window -v -c "#{pane_current_path}"
# set-option xterm-keys off
# unbind -n S-Enter
# bind -n S-Enter display-message "Got shift enter"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'jamylak/rustbox-tmux'
# initialize tmux plugin manager
# (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# run-shell "~/proj/rustbox-tmux/rustbox.tmux"