-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_tmux.conf
158 lines (121 loc) · 4.62 KB
/
dot_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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
# send the prefix to client inside window (ala nested sessions)
bind-key a send-prefix
# make it play nicely with xterm, vim
set-window-option -g xterm-keys on
# toggle last window like screen
bind-key C-a last-window
# previous and next window
bind-key C-n next-window
bind-key C-p previous-window
# set horizontal and vertical binging
unbind % # Remove default binding
unbind '"'
bind-key | split-window -h
bind-key - split-window -v
# vi mode
setw -g mode-keys vi
# copy and paste in vi mode
unbind [
bind Escape copy-mode
unbind P
bind P paste-buffer
# C-a + y to copy to buffer
# C-a + p to paste from buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# move x clipboard into tmux paste buffer
bind C-v run "tmux set-buffer \"$(xsel -o)\"; tmux paste-buffer"
# move tmux copy buffer into x clipboard
bind C-c run "tmux save-buffer - | xsel -pi"
# Reload key
bind r source-file ~/.tmux.conf
set -g default-terminal "screen-256color"
set -g history-limit 5000
# on-screen time for display-panes in ms
set -g display-panes-time 2000
# enable wm window titles
set -g set-titles on
# wm window title string (uses statusbar variables)
set -g set-titles-string "tmux:#I #T"
### set -g status-interval 60
### set -g status-left-length 60
### set -g status-left '#[fg=white,bold]Session: #S | #[fg=cyan]Window: #I #[fg=white]| #[fg=green]Pane: #P #[fg=white]| #[fg=yellow]#(whoami)@#H#[default]'
### set -g status-right-length 60
### set -g status-right '#[fg=#adff2f]#(uptime | cut -d "," -f 3- | sed -e s/average//) #[fg=black]#[bg=white] %d %b %R '
# mouse
# set-option -g mouse-select-pane on
# set-option -g mouse-select-window on
# set-window-option -g mode-mouse on
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
# To copy, drag to highlight text in yellow, press Enter and then release mouse
# Use vim keybindings in copy mode
setw -g mode-keys vi
# color - long overall status bar
set -g status-bg '#303030'
set -g status-fg '#dfff5f'
set -g status-attr dim
TMUX_COLOUR_BORDER="colour241"
TMUX_COLOUR_ACTIVE="colour229"
TMUX_COLOUR_INACTIVE="colour16"
# default window title colors - each inactive
# set -g status-justify centre
set-window-option -g window-status-fg $TMUX_COLOUR_ACTIVE
set-window-option -g window-status-bg $TMUX_COLOUR_BORDER
set-window-option -g window-status-attr dim
# active window title colors - each selected window
set-window-option -g window-status-current-fg white
set-window-option -g window-status-current-bg magenta
set-window-option -g window-status-current-attr bright
# command/message line colors
set -g message-fg white
set -g message-bg black
set -g message-attr bright
# set correct term
set -g default-terminal screen-256color
# open a man page in new window
bind / command-prompt "split-window -h 'exec man %%'"
## Join windows: <prefix> s, <prefix> j
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
bind-key b command-prompt -p "break pane to:" "break-pane -t ':'"
## set status bar
set-option -g status on
# set-option -g status-utf8 on
set-option -g status-interval 2
# set-option -g status-bg colour11
# set-option -g status-fg colour8
set-option -g status-left '#[bold]| #S#[default] |'
set-option -g status-right '#[bold]#(whoami) | #H#[default] '
set-option -g status-right-length 60
set-option -g status-left-length 100
# set-option -g status-left "#(/home/et6339/files/bin/pl.py)"
## highlight active window
set-window-option -g window-status-current-format '#[fg=$TMUX_COLOUR_ACTIVE]#I #W '
## set window notifications
set-option -g visual-activity on
# set-option -g visual-content on
set-window-option -g monitor-activity on
set-window-option -g automatic-rename off
## tmux window titling for X
set-option -g set-titles on
set-option -g set-titles-string '[#I] #W'
set-window-option -g automatic-rename on
set-window-option -g window-status-format '#[fg=$TMUX_COLOUR_INACTIVE]#I #W '
set-window-option -g window-status-attr bold
# starts windows at 1 not 0
set-option -g base-index 1
## pane border and colors
set-option -g pane-active-border-fg yellow
set-option -g pane-border-fg white
# Fix escape key to make it faster
set -sg escape-time 0
## airline theme
source ~/.tmux_airline.conf