-
Notifications
You must be signed in to change notification settings - Fork 8
/
dot_tmux.conf
140 lines (118 loc) · 4.18 KB
/
dot_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
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
# WARNING: Do not bind C-M!! The terminal sees this as <return> being pressed.
# If you set it on accident, you will need to manually unset it :unset -m C-M,
# or start a new session.
#--------------------------------------------
# ~ Options ~
#--------------------------------------------
set -g history-limit 50000
# Increase tmux message display duration.
set -g display-time 3000
# Refresh 'status-left' and 'status-right' more often, from every 15s to 5s
set -g status-interval 5
# Needed for neovim
# Suggested by lazyvim's :checkhealth
set -sg escape-time 10
set -g focus-events on
# True color settings
set -s default-terminal 'tmux-256color'
set -sa terminal-features ',tmux-256color:RGB'
set -as terminal-overrides ',alacritty*:Tc'
set -g mode-keys vi
# End Neovim Specific
# Super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# Position of status bar
set -g status-position top
set -g status-right ''
set -g status-left '#{tmux_mode_indicator} '
#--------------------------------------------
# ~ Keybinds ~
#--------------------------------------------
# Reload Config
bind-key r source-file ~/.local/share/chezmoi/dot_tmux.conf \; display-message "~/.tmux.conf reloaded"
bind-key M split-window -h "vim ~/.tmux.conf"
# Vim Copy Settings
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind P paste-buffer
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# Leader Key
set -g prefix C-g
bind-key C-g send-prefix
# set -g prefix C-Space
# bind-key C-Space send-prefix
# RESIZE PANELS
#
# By 5 Pixels
bind-key -r -T prefix C-Up resize-pane -U 5
bind-key -r -T prefix C-Down resize-pane -D 5
bind-key -r -T prefix C-Left resize-pane -L 5
bind-key -r -T prefix C-Right resize-pane -R 5
# By 1 Pixels
bind-key -r -T prefix M-m resize-pane -L
bind-key -r -T prefix M-n resize-pane -D
bind-key -r -T prefix M-e resize-pane -U
bind-key -r -T prefix M-i resize-pane -R
# Panes
# alt mnei to select panes without leader
bind-key -n M-m select-pane -L
bind-key -n M-n select-pane -D
bind-key -n M-e select-pane -U
bind-key -n M-i select-pane -R
# Select Pane using Leader.
bind m select-pane -L
bind n select-pane -D
bind e select-pane -U
bind i select-pane -R
# Create Pane panes using / and -
unbind '"'
unbind %
# Vertical
bind / split-window -h -c "#{pane_current_path}"
# Horizontal
bind - split-window -v -c "#{pane_current_path}"
# Windows
# ------------------------------------------------------
# Create
bind c new-window -c "#{pane_current_path}"
# Next
bind-key -n M-I next-window
# Previous
bind-key -n M-M previous-window
# # Move Window Left
# bind-key -n M-M swap-window -t -1
# # Move Window Right
# bind-key -n M-I swap-window -t +1
#
# Misc
# ------------------------------------------------------
# Not sure how this got set in the first place.
unbind -n Tab
# Plugins
# ------------------------------------------------------
# Instructions for Tmux Plugin Manager (TPM)
# https://github.com/tmux-plugins/tpm?tab=readme-ov-file#installing-plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'MunifTanjim/tmux-mode-indicator'
# set -g @plugin 'egel/tmux-gruvbox'
# set -g @tmux-gruvbox 'dark'
# Leader + Space to show the menu.
set -g @plugin 'alexwforsythe/tmux-which-key'
set -g @plugin '2kabhishek/tmux-tea'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# Resources
# ------------------------------------------------------
# https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# Notes
# ------------------------------------------------------
# -r allows the keybind to repeat without having to hit the leader
# key again.
# The C- portion of this keybind allows you to continue holding down
# control and hit multiple <spc>+a/t to cycle through windows as opposed
# to repaeting a/t which can som etimes be faster.
# bind -r C-t next-window
# bind -r C-a previous-window
# vim:syntax=tmux