-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
82 lines (65 loc) · 2.74 KB
/
tmux.conf
File metadata and controls
82 lines (65 loc) · 2.74 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
# plugins
set -g @plugin 'tmux-plugins/tpm' # tmux plugin manager
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-resurrect' # save tmux sessions
set -g @plugin 'tmux-plugins/tmux-prefix-highlight' # highlight prefix key
# change prefix
set -g prefix C-q
unbind-key C-b # default
# shell
set-option -g default-shell ${SHELL} # set default shell
set-option -g default-command ${SHELL}
# terminal
set-option -g default-terminal screen-256color # use 256 colors
# set-option -g terminal-overrides 'xterm:colors=256' # override terminal colors
# history
set-option -g history-limit 50000
# display message time
set-option -g display-time 4000
# status bar
set-option -g status-position top
set-option -g status-left-length 90
set-option -g status-right-length 90
set-option -g status-left '#H:[#P]' # hostname and window number
set-option -g status-right '#{prefix_highlight} batt:#{battery_percentage} cpu:#{cpu_percentage} [%y/%m/%d %H:%M]'
set-option -g status-interval 1 # update status bar every 1 second
set-option -g status-justify centre
set-option -g status-bg "colour238" # background color
set-option -g status-fg "colour255" # foreground color
# window
set-option -g base-index 1 # start window index at 1
set-option -g renumber-windows on # renumber windows when a window is closed
# escape
set-option -sg escape-time 10 # set escape time (ms)
# mouse
set-option -g mouse on
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r H resize-pane -L 5
bind-key -r J resize-pane -D 5
bind-key -r K resize-pane -U 5
bind-key -r L resize-pane -R 5
bind-key c new-window -c "#{pane_current_path}"
# vertical split
bind-key - split-window -c "#{pane_current_path}"
bind-key '"' split-window -c "#{pane_current_path}"
# horizontal split
bind-key | split-window -h -c "#{pane_current_path}"
bind-key % split-window -h -c "#{pane_current_path}"
# copy and paste
set-window-option -g mode-keys vi # use vi key
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi V send -X select-line
bind-key -T copy-mode-vi C-v send -X rectangle-toggle
# bind-key -T copy-mode-vi y send -X copy-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'pbcopy'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi Y send -X copy-line
bind-key C-p paste-buffer
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'