-
Notifications
You must be signed in to change notification settings - Fork 8
/
tmux.conf
112 lines (86 loc) · 3.06 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
setw -gq utf8 on
# disable sound bell
set -g bell-action none
# disable visual bell
set -g visual-bell off
# Ctrl-Space is my prefix
set -g prefix C-Space
bind C-space send-prefix
bind C-Space last-window
set -s escape-time 0
# Reload tmux configuration
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." \; move-window -r
# increase history limit
set -g history-limit 500000
# mouse mode on by-default
set-option -g mouse on
set -g default-terminal "xterm-256color"
set -as terminal-overrides ',*:Tc'
set -sa terminal-overrides ",*:dim=\\E[2m"
setw -g xterm-keys on
setw -g focus-events on
# use PREFIX | to split window horizontally and PREFIX - to split vertically
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind-key -n M-z resize-pane -Z
# switch windows with alt+number
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
# alt-tab to switch to last active window
bind-key -n M-tab last-window
# fast pane switching
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# set vi mode for copy mode
setw -g mode-keys vi
# more settings to make copy-mode more vim-like
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
# Resize panes
bind-key -n C-S-Up resize-pane -U 5
bind-key -n C-S-Down resize-pane -D 5
bind-key -n C-S-Left resize-pane -L 10
bind-key -n C-S-Right resize-pane -R 10
# Navigate panes
set -g @navigate-left '-n C-h'
set -g @navigate-down '-n C-j'
set -g @navigate-up '-n C-k'
set -g @navigate-right '-n C-l'
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
# Move windows to left-rigth
bind-key -n M-S-Left swap-window -t -1
bind-key -n M-S-Right swap-window -t +1
# Searching
bind -T copy-mode-vi / command-prompt -i -p "(search down)" "send -X search-forward-incremental \"%%%\""
bind -T copy-mode-vi ? command-prompt -i -p "(search up)" "send -X search-backward-incremental \"%%%\""
bind-key s run "tmux copy-mode; tmux send-keys ?"
if-shell -b 'test $(uname) = "Linux"' ' \
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe "xclip -selection clipboard -i"'
if-shell -b 'test $(uname) = "Darwin"' ' \
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe "pbcopy"'
# Theme
source-file ~/.tmux.colors.conf
# Plugins
set -g @plugin 'laktak/extrakto'
set -g @plugin 'sunaku/tmux-navigate'
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'