-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
157 lines (125 loc) · 5.17 KB
/
Copy pathtmux.conf
File metadata and controls
157 lines (125 loc) · 5.17 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
# Set prefix key to Ctrl-space instead of default Ctrl-b
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Split panes using | and -
# Open the new pane with the same path as the existing pane
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
unbind '"'
unbind %
# Move tmux window left and right using Ctrl+Shift+<Arrow-Direction>
# Tmux updated the swap-window command to not follow the pane, so the -d
# reverts to the old functionality
# Not that when using these dotfiles on a mac with the Alacritty terminal, this
# configuration is overridden by the alacritty key mappings
bind-key -n C-S-Left swap-window -d -t -1
bind-key -n C-S-Right swap-window -d -t +1
# Reload the tmux config file
# Prefix-r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Act like vim when moving around
# Switch panes with Vim movements
# Prefix-h - move left
# Prefix-j - move down
# Prefix-k - move up
# Prefix-l - move right
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Start windows and pane numbering with index 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
# Re-number windows when one is closed
set -g renumber-windows on
# Disable confirm before killing
# Killing a pane is always Prefix-x, but this removes the confirmation
bind-key x kill-pane
# Increase history limit even larger than
# vim-sensibles 50,000
set -g history-limit 1000000
# Enable mouse mode (tmux 2.1 and above)
# Note that mouse support is not yet working in the Microsoft Terminal
# https://github.com/microsoft/terminal/issues/545
set -g mouse on
# ------------------------------------------------e-------------------
# Copy Config
# --------------------------------------------------------------------
# Use v to start selection in copy mode (like vim)
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
# Use y to copy selected text in copy mode (like vim)
# - Windows
# bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "clip.exe"
# - Linux
# bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
# - Mac
bind-key -T copy-mode-vi 'y' send -X copy-selection
# Select and copy with mouse
# - Windows
# bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "clip.exe"
# - Linux
# bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
# ------------------------------------------------e-------------------
# / End Copy Config
# --------------------------------------------------------------------
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
###################################################
# Tmux-sensible does all of the following:
###################################################
# # utf8 is on
# set -g utf8 on
# set -g status-utf8 on
# # address vim mode switching delay (http://superuser.com/a/252717/65504)
# set -s escape-time 0
# # increase scrollback buffer size
# set -g history-limit 50000
# # tmux messages are displayed for 4 seconds
# set -g display-time 4000
# # refresh 'status-left' and 'status-right' more often
# set -g status-interval 5
# # set only on OS X where it's required
# set -g default-command "reattach-to-user-namespace -l $SHELL"
# # upgrade $TERM
# set -g default-terminal "screen-256color"
# # emacs key bindings in tmux command prompt (prefix + :) are better than
# # vi keys, even for vim users
# set -g status-keys emacs
# # focus events enabled for terminals that support them
# set -g focus-events on
# # super useful when using "grouped sessions" and multi-monitor setup
# setw -g aggressive-resize on
# # easier and faster switching between next/prev window
# bind C-p previous-window
# bind C-n next-window
###################################################
# End Tmux-sensible
###################################################
# -------------------------------------------------
# Themes
# -------------------------------------------------
# Catppuccin Theme
thm_black="#24273a"
thm_green="#a6da95"
set -g @plugin 'catppuccin/tmux'
set -g @catppuccin_flavor 'macchiato' # latte (light), frappe, macchiato, mocha
set -g @catppuccin_window_status_style "rounded"
set -g @catppuccin_window_text " #{window_name}"
set -g @catppuccin_window_current_text " #{window_name}"
# Add tmux session name
set "status-left" "#[fg=$thm_black,bg=$thm_green,bold] #S #{prefix_highlight}#[fg=$thm_green,bg=$thm_black,nobold,nounderscore,noitalics]"
# -------------------------------------------------
# / End Themes
# -------------------------------------------------
set -g default-terminal "tmux-256color"
# I don't really understand this terminal overrides setting, but it's needed
# to make nvim colors show up correctly when using tmux in alacritty
# Keeping the two options below in case it needs to be switched for other
# terminals (like the Windows terminal) in the future
# set-option -ga terminal-overrides "alacritty:Tc"
# set -ga terminal-overrides ',xterm-256color:Tc'
# set -ga terminal-overrides ",*256col*:Tc"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'