-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
115 lines (87 loc) · 4.46 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
# -- plugins ------------------------------------------------------------------
set -g @plugin 'tmux-plugins/tmux-battery' # show battery percentage in status bar
# -- general -------------------------------------------------------------------
set -g default-terminal "screen-256color" # colors!
setw -g xterm-keys on
set -s escape-time 10 # faster command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s focus-events on
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
setw -q -g utf8 on
set -g history-limit 5000 # boost history
# edit configuration
bind e new-window -n "~/.tmux.conf.local" "EDITOR=\${EDITOR//mvim/vim} && EDITOR=\${EDITOR//gvim/vim} && \${EDITOR:-vim} ~/.tmux.conf.local && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\""
# reload configuration
bind r source-file ~/.tmux.conf
# -- Appearence ----------------------------------------------------------------
set -g status-justify left
set -g @batt_icon_charge_tier8 '🌕'
set -g @batt_icon_charge_tier7 '🌖'
set -g @batt_icon_charge_tier6 '🌖'
set -g @batt_icon_charge_tier5 '🌗'
set -g @batt_icon_charge_tier4 '🌗'
set -g @batt_icon_charge_tier3 '🌘'
set -g @batt_icon_charge_tier2 '🌘'
set -g @batt_icon_charge_tier1 '🌑'
set -g @batt_icon_status_charged '👍'
set -g @batt_icon_status_charging '⚡'
set -g @batt_icon_status_discharging '🔋'
set -g @batt_icon_status_unknown ''
set -g @batt_remain_short 'true'
set-option -g status on
set-option -g status-interval 1
set-option -g status-justify 'left'
set-option -g status-left-length 9999
set-option -g status-right-length 9999
set -g status-right '#{prefix_highlight}#[fg=colour235,bg=colour235]#[fg=colour121,bg=colour235] %a %h-%d %H:%M #[fg=colour238,bg=colour235]#[fg=colour222,bg=colour238] #h #[fg=colour154,bg=colour238]#[fg=colour232,bg=colour154]'
set -g status-left '#[fg=colour154]#{battery_color_charge_bg} #{battery_icon_charge} #{battery_remain} #{battery_icon_status}#[fg=colour233, bg=colour48]#(osascript $HOME/.tmux/segments/applemusic.scpt)#[fg=colour233, bg=colour48]#(osascript $HOME/.tmux/segments/mailunread.scpt)#{battery_color_charge_fg} '
set -g window-status-current-format '#[fg=colour232, bg=colour34]#{window_index}:#{window_name}#[bg=colour232,fg=colour34] '
set -g window-status-format '#[fg=colour232, bg=colour35]#{window_index}:#{window_name}#[bg=colour232,fg=colour35] '
# -- display -------------------------------------------------------------------
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles off # set terminal title
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
# clear both screen and history
bind -n C-l send-keys C-l \; run 'sleep 0.1' \; clear-history
# activity
set -g monitor-activity on
set -g visual-activity off
# -- navigation ----------------------------------------------------------------
# Switch panes with alt-arrowKey
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# create session
bind C-c new-session
# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# maximize current pane
bind + run 'cut -c3- ~/.tmux.conf | sh -s _maximize_pane "#{session_name}" #D'
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# window navigation
unbind n
unbind p
bind -r C-h previous-window # select previous window
bind -r C-l next-window # select next window
bind Tab last-window # move to last active window
set -g mouse off
# -- urlview -------------------------------------------------------------------
bind U run "cut -c3- ~/.tmux.conf | sh -s _urlview #{pane_id}"
# !IMPORTANT - Keep this line at the bottom of the config.
run '~/.tmux/plugins/tpm/tpm'