-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
123 lines (99 loc) · 3.73 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
113
114
115
116
117
118
119
120
121
122
# Start zsh for each new command that is opened
set -g default-command "zsh"
# Remap prefix to the same as screen.
set -g prefix C-a
unbind C-b
# Last active window
bind-key C-a last-window
# Unbind from remote screen.
# http://superuser.com/questions/249659/how-to-detach-a-tmux-session-that-itself-already-in-a-tmux
# http://stackoverflow.com/questions/14492744/how-do-you-detach-a-remote-screen-session-in-byobu-tmux
unbind C-a
bind C-a send-prefix
bind C-b send-prefix
# swap windows/panes
bind-key h swap-window -t -1
bind-key H swap-window -t +1
bind-key j swap-pane -D
bind-key J swap-pane -U
# Fix the delay after command sequence.
set -s escape-time 0
# Set 256 colors
set -g default-terminal "screen-256color"
# Send command to the inner session if running tmux inside tmux.
bind-key a send-prefix
# Start window numbering at 1
set -g base-index 1
# Enable vi mode and v(isual) and y(ank) mode.
set-window-option -g mode-keys vi
set-window-option -g utf8 on
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
bind-key -t vi-copy 'V' rectangle-toggle
# use "v" and "s" to do vertical/horizontal splits, like vim
bind s split-window -v
bind v split-window -h
# automatically renumber windows in a session
set-option -g renumber-windows on
# use the vim resize keys (the number specifies for how much to resize)
bind < resize-pane -L 10
bind > resize-pane -R 10
# pass certain keys to applications, like vim, running in tmux
set-option -gw xterm-keys on
bind-key -n C-Right send-keys C-Right
# pass environment variables
set -g update-environment -r
# close the pane/window without confirmation
#bind-key & kill-window
#bind-key x kill-pane
# tmux logging: start with 'ctrl-b h' and stop with 'ctrl-b H'
bind-key l pipe-pane 'cat >> $HOME/Desktop/tmux-$(date +"%Y%m%d").log' \; display-message 'Logging started.'
bind-key L pipe-pane \; display-message 'Logging ended.'
#
# Window titles.
# #H Hostname of local host
# #I Current window index
# #P Current pane index
# #S Current session index
# #T Current window title
# #W Current window name
# # A literal ‘#’
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'
setw -g automatic-rename on
# Status bar
set -g status-bg black
set -g status-fg blue
set -g status-interval 5
set -g status-left-length 90
set -g status-right-length 120
set -g status-right "#100T %H:%M %d-%b-%y"
# the window status icons should be left aligned
set -g status-justify left
# color of the currently active window
set-window-option -g window-status-current-bg red
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
setw -g window-status-current-bg colour0
setw -g window-status-current-fg colour11
setw -g window-status-current-attr dim
setw -g window-status-attr reverse
setw -g window-status-content-bg colour0
setw -g window-status-content-fg colour11
setw -g window-status-content-attr bold,blink,reverse
# Enable mouse scrolling, selection of the window and pane.
set -g mode-mouse on
setw -g mouse-select-window on
setw -g mouse-select-pane on
# Notify us on activity in window
setw -g monitor-activity on
set -g visual-activity on
# History
set -g history-limit 100000
# Enable copy/pasting from tmux to X:
# move x clipboard into tmux paste buffer
# move tmux copy buffer into x clipboard:
bind-key C-p run-shell -b "tmux set-buffer \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"
bind-key C-Right run-shell -b "tmux set-buffer \"$(xclip -o -selection primary)\"; tmux paste-buffer"
bind-key C-y run-shell -b "tmux show-buffer | xclip -i -selection clipboard"
bind-key C-Left run-shell -b "tmux show-buffer | xclip -i -selection primary"