-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
85 lines (66 loc) · 3.01 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
########################## MOUSE SETTINGS #################################
set -g mouse on
set -g default-terminal "xterm-256color"
set-window-option -g xterm-keys on
# --------- followed https://bbs.archlinux.org/viewtopic.php?id=204091 for mouse set up ------------
bind -n WheelUpPane 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
bind -n C-WheelDownPane select-pane -t= \; send-keys -M
# reset prefix keybinding
set -g prefix C-a
# set window toggling
#unbind C-Left
#unbind C-Right
bind -n C-Left previous-window
bind -n C-Right next-window
# clear command on tmux
bind K send-keys "clear"\; send-keys "Enter"
#count windows and panes from 1
set -g base-index 1
setw -g pane-base-index 1
#set escape timeout to low threshold (10-20 ms) for vim
set -g escape-time 10
# reset tmux
bind r source-file ~/.tmux.conf\; display "Reloaded"
# active window title colors
set-window-option -g allow-rename off
# keep current path when creating new windows or panes
bind-key c new-window -c "#{pane_current_path}"
bind-key % split-window -h -c "#{pane_current_path}"
bind-key '"' split-window -c "#{pane_current_path}"
# --------------------- STATUS BARS --------------------------
BATTERY_STATUS="#{battery_status_bg} Batt: #[bold]#{battery_percentage} #{battery_remain}#[default]"
UTC_DATE="#[bg=colour240]#[fg=white] #(date -u +'UTC %H:%M') #[fg=black,bold]| #[default]"
REGULAR_DATE="#[fg=white]#[bg=colour240] %d %b %R"
set -g status-left "#{?client_prefix,#[bg=magenta]#[fg=white] tmux #[default],}#[fg=colour159,bold]#[bg=colour240] #S "
set -g status-right "$BATTERY_STATUS$UTC_DATE$REGULAR_DATE"
set -g status-right-length 50
# ------------------- COLOURS ------------------------
#set -g default-terminal "screen-256color"
# set colors for the active window
# START:activewindowstatuscolor
set -g pane-border-style fg=blue
set -g pane-active-border-style bg=default,fg=yellow
# setw -g window-status-current-attr default
# END:activewindowstatuscolor
setw -g status-style bg=colour235
setw -g window-status-current-style fg=colour132,bg=default,bright,fg=black,bg=blue
setw -g window-status-format "#I:#W |"
setw -g window-status-style fg=colour245
setw -g window-status-current-format " ▶ #I:#W #P "
# -------------- COPY / PASTE ---------------------
# Copy-paste integration
set-option -g default-command "reattach-to-user-namespace -l zsh"
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe "reattach-to-user-namespace pbcopy"
# Bind ']' to use pbpaste
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# ------------------- PLUGINS ---------------------
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-battery'
run '~/.tmux/plugins/tpm/tpm'