-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
105 lines (77 loc) · 2.83 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
###########################
# Configuration
###########################
source ~/.tmux-local.conf
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 65536
#use vim key bindings
setw -g mode-keys vi
# 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-selection
# start window index at 1
set -g base-index 1
# start pane index at 1
setw -g pane-base-index 1
# decrease command delay (increases vim responsiveness)
set -sg escape-time 1
# increase repeat time for repeatable commands
set -g repeat-time 1000
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
# re-number windows when one is closed
set -g renumber-windows on
# prevent named windows from changing name
set-option -g allow-rename off
###########################
# Key Bindings
###########################
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# quick view of processes,
bind '~' split-window "exec glances"
bind '`' new-window "exec glances"
unbind k
bind k send-keys -R \; clear-history
###########################
# Status Bar
###########################
# refresh interval
set -g status-interval 10
# color
set -g status-bg colour235
set -g status-fg white
# show session, window, pane in left status bar
set -g status-left-length 20
# set -g status-left '#[fg=green]#S#[fg=blue] #I:#P#[default]'
set -g status-left ''
# show hostname, date, time, and battery in right status bar
set -g status-right '#[fg=green]#H#[default] | Batt: #{battery_icon} #{battery_percentage} #{battery_remain} | %a %h %d %H:%M '
set -g status-right-length 80
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
###################################################
# Smart pane switching with awareness of vim splits
###################################################
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
#########
# Plugins
#########
set -g @plugin 'tmux-plugins/tmux-battery'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'