-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
103 lines (81 loc) · 3.09 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
# Zac's tmux Config File
# store in the home directory as .tmux.conf
# Based on Jay LaCroix's Config File from learnlinux.tv.
# Version 1.8
# Date: 2025-2-22
# Just as a note. If you can't get copy/paste to work (like in ParrotOS or Kali), a trick I found works is:
# Install xclip
# put an alias in .bashrc `tmc='tmux show-buffer | xclip -selection clipboard'
# this will copy the selection to the system clipboard.
# Set a reload key for the tmux config to reload
bind-key r source-file ~/.tmux.conf \; display-message "!! tmux.conf reloaded !!"
# Mouse Mode including tmux-yank configuration
set -g mouse on
set -g @yank_with_mouse on
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Set easier window split keys
bind-key v split-window -h
bind-key h split-window -v
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Easily reorder windows with CTRL+SHIFT+Arrow
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# Synchronize panes
bind-key y set-window-option synchronize-panes\; display-message "synchronize mode toggled."
# Rebind the k key to kill a darn window
bind-key k kill-window
# Key bindings for copy-paste
setw -g mode-keys vi
unbind p
bind p paste-buffer
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# Lengthen the amount of time status messages are displayed
set-option -g display-time 3000
set-option -g display-panes-time 3000
# Set the base-index to 1 rather than 0
set -g base-index 1
set-window-option -g pane-base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# Allow the arrow key to be used immediately after changing windows.
set-option -g repeat-time 0
# No delay for escape key press
set -sg escape-time 0
# Set Terminal Override and Default Editor for Moving the Cursor (Cult of VIM)
set -g default-terminal tmux-256color
set -g status-keys vi
# Set the base-index to 1 rather than 0
set -g base-index 1
set-window-option -g pane-base-index 1
# List of plugins
# run git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm for this to work
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# For tmux-yank, you need to install wl-clipboard and/or xsel
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'dracula/tmux'
# Dracula Configuration
set -g @dracula-plugins "cpu-usage ram-usage time"
set -g @dracula-show-left-icon "#H | #S"
# Turn Local Tmux Prefix Off/On when working with SSH sessions that also have tmux.
bind -T root F12 \
set prefix None \;\
set key-table off \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
display-message "Local Prefix Off" \;\
refresh-client -S
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
display-message "Local Prefix On" \;\
refresh-client -S
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'