forked from dotphiles/dotphiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
104 lines (87 loc) · 2.81 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
# General settings
set -g default-terminal screen-256color
set -g history-limit 10000
set -g buffer-limit 20
# No delay for escape key press
#set -sg escape-time 0
set -g display-time 1500
#set -g remain-on-exit off
#set -g repeat-time 300
#setw -g allow-rename off
#setw -g automatic-rename off
#setw -g aggressive-resize on
# Appearance customization
# set -g status-bg black
# set -g status-fg white
# set -g window-status-current-fg green
# Custom modifier key
#set -g prefix C-Space
set -g prefix C-a
unbind-key C-b
#bind-key C-Space send-prefix
bind-key C-a send-prefix
# Terminal improvements
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@"
set-window-option -g automatic-rename on
set-option -g set-titles on
# Start index of window/pane with 1, because we're humans, not computers
set -g base-index 1
setw -g pane-base-index 1
#set -g mouse on
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
#set -g status-keys vi
set -g status-keys emacs
set -g mode-keys emacs
# Clear scrollback buffer
bind l clear-history
# Custom key bindings to split the window
bind-key v split-window -h
bind-key s split-window -v
# Reload tmux config
bind r source-file ~/.tmux.conf
# Shift arrow to switch panes
bind -n S-Left select-pane -L
bind -n S-Right select-pane -R
bind -n S-Up select-pane -U
bind -n S-Down select-pane -D
# Control arrow to create panes
bind -n C-Down split-window -v
bind -n C-Up split-window -v -b
bind -n C-Right split-window -h
bind -n C-Left split-window -h -b
# Easier window navigation
bind -n C-Tab next-window
bind -n C-S-Tab previous-window
bind -n C-S-Left previous-window
bind -n C-S-Right next-window
# Ctrl + Alt + Left/Right to move windows
bind-key -n C-M-Left swap-window -t -1
bind-key -n C-M-Right swap-window -t +1
# Copy to cygwin clipboard
bind -n C-t run "tmux save-buffer - > /dev/clipboard"
# Kill tabs quicker
bind-key x kill-pane
# X11 clipboard
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
#bind -t emacs-copy y copy-pipe "xclip -i -sel clip"
#bind-key -t emacs-copy MouseDragEnd1Pane copy-pipe "xclip -se c -i"
#bind-key -t emacs-copy MouseDragEnd1Pane copy-pipe "xclip -selection clipboard -i"
bind -T root MouseDown2Pane run -b "xclip -selection clipboard -o | tmux load-buffer - && tmux paste-buffer -s ' '"
# When mouse mode is off, mouse works like in a regular terminal window.
bind m run "\
tmux show-options -g | grep -q "mouse\\s*on"; \
if [ \$? = 0 ]; \
then \
toggle=off; \
else \
toggle=on; \
fi; \
tmux display-message \"mouse is now: \$toggle\"; \
tmux set-option -w mouse \$toggle; \
tmux set-option -g mouse \$toggle; \
"
# Plugins
#run-shell ~/.tmux-plugins/resurrect/resurrect.tmux