-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
144 lines (108 loc) · 3.75 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
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
# PLUGINS
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# set -g @plugin 'catppuccin/tmux#v2.1.2' # no need
# set -g @catppuccin_flavor 'mocha' # latte, frappe, macchiato or mocha
# for tmux-resurrect to persist tmux sessions
# default will be <prefix> + <C-s> to save
# and <prefix> + <C-r> to restore
# set -g @resurrect-save 'prefix + custom_key'
# set -g @resurrect-restore 'prefix + custom_key'
# navigate panes just like in neovim
set -g @plugin 'christoomey/vim-tmux-navigator'
# <prefix>I to install plugins each time we add new ones
run '~/.tmux/plugins/tpm/tpm'
# KEYBINDS
# make `Ctrl+b r` reload the config file
unbind r
bind r source-file ~/.tmux.conf
# set prefix to C-Space
unbind C-b
set-option -g prefix C-Space
bind C-Space send-prefix
# duplicate current window in current dir
bind D new-window -c "#{pane_current_path}"
# split panes using | and _, in current dir
unbind '"'
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
# equal split panes
bind = select-layout tiled
# navigate windows
bind-key -n M-l next-window
bind-key -n M-h previous-window
# use vim shortcuts in tmux select and copy mode
set-window-option -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind -T copy-mode-vi Escape send -X cancel
bind -T copy-mode-vi H send -X start-of-line
bind -T copy-mode-vi L send -X end-of-line
# create new session, prompt for name
unbind a
bind a command-prompt -p "New session name:" "new-session -s '%%'"
# rename the current session
bind R command-prompt -I "#S" "rename-session '%%'"
# find all session
unbind k
bind k command-prompt -p find-session 'switch-client -t %%'
# choose session
unbind j
bind j choose-tree
# cycle through sessions with <Alt>i and <Alt>o
bind-key -n M-i switch-client -p # Go to previous session with Alt+9
bind-key -n M-o switch-client -n # Go to next session with Alt+0
# SETTINGS
# Enable true color support for tmux
set-option -a terminal-features 'xterm-256color:RGB' # the value of $TERM outside of tmux + `:RGB`
set-option -g default-terminal "tmux-256color" # must be tmux-256color
# boost history
set-option -g history-limit 10000
# focus event
set-option -g focus-events on
# time tmux will wait for keymaps
set -s escape-time 0
# start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# enable mouse control
set -g mouse on
# don't rename windows automatically
set-option -g allow-rename off
# set -g status-style 'bg=#333333 fg=#5eacd3'
# DESIGN TWEAKS
# don't do anything when a 'bell' rings
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
# clock mode
setw -g clock-mode-colour yellow
# copy mode
setw -g mode-style 'fg=black bg=red bold'
# panes
set -g pane-border-style 'fg=red'
set -g pane-active-border-style 'fg=yellow'
# statusbar
set -g status-position bottom
set -g status-justify left
set -g status-style 'fg=red'
set -g status-left ''
set -g status-left-length 10
set -g status-right-style 'fg=black bg=yellow'
set -g status-right '%Y-%m-%d %H:%M '
set -g status-right-length 50
setw -g window-status-current-style 'fg=black bg=red'
setw -g window-status-current-format ' #I #W #F '
setw -g window-status-style 'fg=red bg=black'
setw -g window-status-format ' #I #[fg=white]#W #[fg=yellow]#F '
setw -g window-status-bell-style 'fg=yellow bg=red bold'
# messages
set -g message-style 'fg=yellow bg=red bold'