Repository navigation
Expand file tree
/
Copy path.tmux.conf
More file actions
173 lines (116 loc) · 6.23 KB
/
Copy path.tmux.conf
File metadata and controls
173 lines (116 loc) · 6.23 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# Slightly annoying C-x C-x for C-x but goot, For Personal setup-compatibility. C-b is still usebale
set -g prefix2 C-x
bind C-x send-prefix -2
# Make sure you have this in tmux. for inserting new line. It fixes tui new line in TUI Applications inside tmux.
bind-key -n M-Enter send-keys "\e" Enter
# for vim.g.clipboard = "osc51" sake.
set -s set-clipboard on
set -g focus-events on
set -g window-size latest
# for nvim ESC delay fix in tmux
set -sg escape-time 0
set -g status-style 'bg=#333333 fg=#5eacd3'
# Start window and pane numbering at 1
set -g base-index 1
# Renumber windows automatically to prevent gaps
set -g renumber-windows on
# Enable full mouse support
set -g mouse on
# Allow Tmux to use the OSC 52 escape sequences for copy/paste
set -g allow-passthrough on
# If you are still having issues, explicitly bind the copy/paste operations to OSC 52
# (These lines are sometimes only necessary if you use Tmux's copy mode, but they help.)
set -w -g automatic-rename on
set -g status-position bottom
# .setw
setw -g pane-base-index 1
####
#### .set-option
####
set-option -g default-terminal "tmux-256color"
# This may be better for certain TUI applications so the keys we send are kinda similar but I prefer tmux-256color color I think.
# for those specefic TUIs just use default kitty... it's alright and fine (only uses like a few mb it's fine.)
# set -g default-terminal xterm-256color
set-option -g status-right "%Y-%m-%d %H:%M"
set-option -g status-left-length 30
set-option -g status-right-length 0
# Set a higher history limit
set-option -g history-limit 10000
# I hate why have this when you can do tab+<keyd>
# Allow repeating commands without re-typing the prefix (e.g., C-a > >)
# set-option -g repeat-time 500
set-option -g repeat-time 0
# Use vi-style keys in copy mode
set-window-option -g mode-keys vi
# bind Enter run-shell -b "tmux capture-pane -p -S - | xclip -selection clipboard -in >/dev/null 2>&1" \; display-message "Copied history to clipboard"
# bind Enter run-shell "tmux capture-pane -p -S - | xclip -selection clipboard -in" \; display-message "Copied history to clipboard"
# sadly it copies spaces bellow commands.
# bind Enter run-shell -b "tmux capture-pane -p -S - | xclip -in -selection clipboard -filter | xclip -in -selection primary >/dev/null 2>&1" \; display-message "Copied history to clipboard and primary"
# This is way better it doesn't copy extra spaces bellow command.
bind Enter capture-pane -S - -J \; run-shell -b 'tmux save-buffer - | sed -z "s/[[:space:]]*\$//" | xclip -in -selection clipboard >/dev/null 2>&1; tmux save-buffer - | sed -z "s/[[:space:]]*\$//" | xclip -in -selection primary >/dev/null 2>&1' \; display-message "Copied history to clipboard and primary"
bind-key -T copy-mode-vi - run-shell "~/.local/scripts/tmux-copy-mode-lines.sh; tmux copy-mode"
# I hope this fking works
bind-key -T copy-mode-vi C-q send-keys -X rectangle-toggle
# Trying to make emacs like copy-mode in like vi mode for fun.
bind -T copy-mode-vi C-Left send -X previous-word
bind -T copy-mode-vi C-Right send -X next-word-end
bind -T copy-mode-vi M-< send -X history-top
bind -T copy-mode-vi M-> send -X history-bottom
# Center the view around the cursor (like "zz" in Vim)
bind-key -T copy-mode-vi C-l send -X scroll-middle
bind-key -T copy-mode C-l send -X scroll-middle
# THIS IS A LIE THERE IS NO SUCH THING AS RECTRANGLE-TOGGLE!!!
# bind -T copy-mode-vi q send-keys -X rectangle-toggle
####
#### .bind
####
# New window in same path
bind c new-window -c "#{pane_current_path}"
# Split panes in same path (default keys)
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
bind -T off F11 \
set -u prefix \;\
set -u key-table \;\
set -u status-style \;\
refresh-client -S
bind -T root F11 \
set prefix None \;\
set key-table off \;\
set status-style "fg=colour245,bg=colour235" \;\
if-shell -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind "'" run-shell "~/.local/scripts/tmux-scratch.sh"
bind-key -n 'M-`' last-window
bind-key -r g display-popup -d '#{pane_current_path}' -w 90% -h 90% -E "lazygit"
bind b display-popup -B -x0 -y S -w 100% -h 1 \
-s 'bg=colour234,fg=colour253' \
-E "\
~/.local/scripts/tmux-ido-window.sh | \
awk -F: '{print \$1}' | \
xargs -I{} tmux select-window -t {}"
bind C display-popup -w 70% -h 30% -E "qalc"
bind-key -r t run-shell "tmux neww tmux-sessionizer"
bind-key M-l run-shell "tmux-sessionizer -s 1"
bind M-v set-window-option synchronize-panes
bind -r "<" swap-window -d -t -1
bind -r ">" swap-window -d -t +1
bind - run-shell "~/.local/scripts/tmux-copy-mode-lines.sh"
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi C-Space send-keys -X begin-selection
bind-key -T copy-mode-vi C-g send-keys -X clear-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "tmux save-buffer - | xclip -in -selection clipboard >/dev/null 2>&1; tmux save-buffer - | xclip -in -selection primary >/dev/null 2>&1"
bind-key -T copy-mode-vi M-w send-keys -X copy-pipe-and-cancel "tmux save-buffer - | xclip -in -selection clipboard >/dev/null 2>&1; tmux save-buffer - | xclip -in -selection primary >/dev/null 2>&1"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "tmux save-buffer - | xclip -in -selection clipboard >/dev/null 2>&1; tmux save-buffer - | xclip -in -selection primary >/dev/null 2>&1"
bind-key -T copy-mode-vi i send-keys -X select-word
bind-key -T copy-mode-vi I send-keys -X cursor-right \; send-keys -X previous-space \; send-keys -X begin-selection \; send-keys -X next-space-end
bind-key -T copy-mode-vi q send-keys -X rectangle-toggle
bind-key -T copy-mode-vi s send-keys -X copy-pipe-and-cancel "ssh -i ~/.ssh/id_ed25519 -p 8022 u0_a662@100.126.224.121 'termux-clipboard-set'"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-yank'
# set -g @override_copy_command 'xclip -selection clipboard'
set -g @override_copy_command 'xclip -in -selection clipboard >/dev/null 2>&1; tmux save-buffer - | xclip -in -selection primary >/dev/null 2>&1'
run '~/.tmux/plugins/tpm/tpm'