-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
101 lines (77 loc) · 2.41 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
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
# Using C-Space as a prefix
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Use prefix-space to go to last pane
bind Space last-pane
# Split windows with s and v
unbind %
bind s split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
# Create new window with c and ^C
bind c new-window -c "#{pane_current_path}"
bind C-c new-window -c "#{pane_current_path}"
# Start numbering at 1
set -g base-index 1
# Remember all the things
set-option -g history-limit 100000
# re-number windows when one is closed
set -g renumber-windows on
# color
set -g default-terminal "screen-256color"
# Agressive resize
setw -g aggressive-resize on
# Low escape time
set -sg escape-time 0
# enable activity alerts
setw -g monitor-activity on
set-option -gw window-status-activity-style bg=black,fg=red,bold
# Truecolor
set-option -ag terminal-overrides ",screen-256color:Tc"
# Mouse controls
set -g mouse
# Jump to last window with o and C-o
# Use M-o to rotate panes
bind o last-window
bind C-o last-window
# Pane switching with vim binding
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind C-h select-pane -L
bind C-j select-pane -D
bind C-k select-pane -U
bind C-l select-pane -R
# Reorder windows using < and >
bind-key < swap-window -d -t -1
bind-key > swap-window -d -t +1
# Copy mode as in Vim
set -g mode-keys vi
bind-key C-[ copy-mode
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 'y' send -X copy-pipe-and-cancel "xclip -in -selection clipboard"
# No need to unpress Ctrl to change window
bind C-n next-window
bind C-p previous-window
# Reload Config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Status bar config
set-option -g status-justify left
set -g status-style bg=black,fg=white
set -g window-status-current-style bg=white,fg=black,bold
set -g status-interval 5
set -g status-left-length 36
# (Session) |user@host| Windows01 Window02 Window03 ....
set -g status-left '#[fg=white](#S) #[fg=green]|#(whoami)@#h|'
set -g status-right '#{prefix_highlight}'
# tmux-yank
set -g @yank_selection 'clipboard -f | xclip -selection primary'
# Initialize TPM
run '~/.tmux/plugins/tpm/tpm'