-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
114 lines (84 loc) · 3.97 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
# Use ctrl-a for prefix instead of crtl-b
unbind C-b
set-option -g prefix C-a
bind C-a send-prefix
# Create new windows/panes in the same directory
unbind c
bind c new-window -c '#{pane_current_path}'
unbind "\""
bind "\"" split-window -c '#{pane_current_path}'
unbind "\%"
bind "\%" split-window -h -c '#{pane_current_path}'
# Use [prefix]-r to reload config
bind r source-file ~/.tmux.conf
# Use 1 instead of 0 for the first window/pane
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Use mouse to select panes/windows/etc.
set-option -g mouse on
# Remove delay on escape key
set-option -sg escape-time 0
# Act like vim!
set-option -g status-keys vi
set-window-option -g mode-keys vi
set-window-option -g automatic-rename on
# Needed to use shift up/down/left/right in vim
set-window-option -g xterm-keys on
# Rebind Tmux sessions into the right user space
set-option -g default-shell $SHELL
set-option -g default-command "reattach-to-user-namespace -l ${SHELL}"
# https://github.com/sonph/onehalf/tree/master/vim
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
# Rebind these as un-repeatable keys
unbind Up
bind-key Up select-pane -U
unbind Down
bind-key Down select-pane -D
unbind Left
bind-key Left select-pane -L
unbind Right
bind-key Right select-pane -R
# Allow mouse scrolling on a pane to enter/exit copy mode
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
# Export tmux buffer to OSX pasteboard
bind-key y run-shell "tmux save-buffer - | reattach-to-user-namespace pbcopy\; tmux display 'Buffer copied'"
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
# Shortcut to hop between sessions
bind-key C choose-session
# Amount of time for which status line messages and other indicators
# are displayed. time is in milliseconds.
set -g display-time 5000
# Status bar background
set-window-option -g status-style bg=colour245,fg=white
# Status bar pane pane selector
set-window-option -g window-status-style bg=default,fg=black,bright
# Status bar, highlighted pane
set-window-option -g window-status-current-style fg=white,bright,bg=default
set-window-option -g window-status-bell-style bg=red,fg=white
set-window-option -g window-status-activity-style bg=red,fg=colour0,bright
# Pane separator colors
set-option -g pane-active-border-style fg=blue,dim
set-option -g pane-border-style fg=blue,dim
# Clock foreground color
set-window-option -g clock-mode-colour brightblue
# Conditionals
# #{?condition,true,false}
# is last window #{?#{==:#{session_windows},#{window_index}},true,false}"
# is first window #{?#{==:#{session_windows},#{window_index}},true,false}"
# glyphs
#
set-option -g window-status-separator ''
set-option -g status-left "#[fg=white,bright,bg=blue] #{?#S,#S,#{=21:pane_title}} #[fg=default,bg=default]"
set-option -g status-left-length 15
set-window-option -g window-status-format "#{?#{==:#{window_index},1},#[fg=blue#,bg=default]#[fg=default#,bg=default],} #I:#W "
set-window-option -g window-status-current-format "#{?#{==:#{window_index},1},#[fg=blue#,bg=green]#[fg=default#,bg=green],#[fg=colour245#,bg=green]#[fg=black,bright#,bg=green]} #I:#W #[fg=green,bg=default]#[fg=default,bg=default]"
set-option -g status-right "#[fg=magenta]#[fg=white,bright,bg=magenta]#{?#S, #{=21:pane_title} #[fg=default]#[fg=white],} #{battery_icon_status} #{battery_percentage} #[fg=red,bg=magenta]#[fg=white,bg=red] %H:%M %d-%b-%y "
set-option -g status-right-length 70
run-shell ~/.tmux/tmux-battery/battery.tmux