-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
84 lines (63 loc) · 2.19 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
# C-a ? : list all command
#-- base settings --#
set -g default-terminal tmux-256color
# set -g default-terminal "xterm-256color-italic"
# set -g default-terminal "xterm-24bit"
# set -g terminal-overrides ',xterm-24bit:Tc'
set -s extended-keys on
set-window-option -g xterm-keys on
set -g display-time 3000
set -g escape-time 0
set -g history-limit 999999
set -g base-index 0
set -g pane-base-index 1
# bindkeys
# prefix key (C-a)
set -g prefix C-a
unbind C-b
bind a send-prefix
# create a new window starting in the current working directory
bind C-c new-window -c "#{pane_current_path}"
# split window
unbind '"'
bind - splitw -v # vertical split (prefix -)
unbind %
bind | splitw -h # horizontal split (prefix |)
# switch to the last window
bind l last-window
# resize pane
bind -r C-k resizep -U 5 # upward (prefix Ctrl+k)
bind -r C-j resizep -D 5 # downward (prefix Ctrl+j)
bind -r C-h resizep -L 5 # to the left (prefix Ctrl+h)
bind -r C-l resizep -R 5 # to the right (prefix Ctrl+l)
# swap pane
bind C-u swapp -U # swap with the previous pane (prefix Ctrl+u)
bind C-d swapp -D # swap with the next pane (prefix Ctrl+d)
# copy mode
set -g mode-keys vi
bind Escape copy-mode
# iTerm2 > Preferences > General -> Selection -> Applications in terminal may access clipboard
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection
bind -T copy-mode-vi Escape send -X cancel
# misc
bind S set synchronize-panes
# reload config (prefix r)
bind r source ~/.tmux.conf \; display "Configuration reloaded!"
set -g allow-rename off
# use zsh
set -g default-command zsh
# window status
set-window-option -g window-status-current-style 'fg=terminal bold underscore,bg=brightred'
set-window-option -g window-status-bell-style 'fg=brightred blink,bg=default'
# pane
set -g pane-active-border-style "fg=brightmagenta"
# statusbar
set -g status-interval 2
set -g status-left "#{?pane_synchronized,#[bg=blue],}[#S]#[bg=default]|"
set -g status-right "#(tmux-mem-cpu-load -g 0 -a 2 -i 2)"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
# Local config
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
run '~/.tmux/plugins/tpm/tpm'