-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
100 lines (93 loc) · 3.9 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
# ================ General Config ====================
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'jimeh/tmux-themepack'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @themepack 'powerline/default/cyan' # use this theme for tmux
set -g @resurrect-capture-pane-contents 'on' # allow tmux-ressurect to capture pane contents
set -g @continuum-restore 'on' # enable tmux-continuum functionality
# UTF8
# Change border colors
set-option -g pane-border-fg black #base02
set-option -g pane-active-border-fg white
# 256 color
set -g default-terminal "screen-256color"
# No escape time for vi mode
set -sg escape-time 0
# Set first window index to 1 (instead of 0)
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Navigate using Vim rather than Emacs (default)
setw -g mode-keys vi
# Ensure keyboard shortcuts inside vim still work
setw -g xterm-keys on
# ================ Keybindings =======================
# Set Ctrl-a as the default prefix key combination, unbind Ctrl-b
unbind C-b
set -g prefix C-a
# Enable screen-like C-a C-a moving to last window
bind-key C-a last-window
# Force reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Create splits and vertical splits
bind-key v split-window -p 50 -h -c "#{pane_current_path}"
bind-key ^V split-window -p 50 -h -c "#{pane_current_path}"
bind-key s split-window -p 50 -c "#{pane_current_path}"
bind-key ^S split-window -p 50 -c "#{pane_current_path}"
# 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"
# Pane resize in all four directions using vi bindings.
# Shift-ctrl-<h,j,k,l> in iTerm.
bind -r H resize-pane -L 20
bind -r J resize-pane -D 20
bind -r K resize-pane -U 20
bind -r L resize-pane -R 20
# ================ Status bar ========================
# Message colors
set -g message-bg colour015
set -g message-fg colour235
# Turn on status bar always
set-option -g status on
# Change update interval
set -g status-interval 5
# Grey background, white foreground
set-option -g status-bg colour015
set-option -g status-fg colour015
# Battery icons
set -g @batt_discharging_icon "⚡️ "
set -g @batt_charging_icon "🔋 "
# Online Status
set -g @online_icon "🌎"
set -g @offline_icon "🚫"
# Status bar left
setw -g window-status-format " #I:#W"
setw -g window-status-current-format " #[fg=green] #I:#W"
setw -g window-status-current-format " #[fg=green] #I:#W"
set -g status-justify left
set -g status-left-length 0
set -g status-left ""
set -g status-right-length 50
set -g status-right " #[fg=black]❬❬❬#[fg=green]#{battery_icon} #{online_status}#[fg=green]%l:%M%p #[fg=brightblack]● #[fg=brightmagenta]%a#[fg=green] %D#[fg=brightblack]❭❭❭"
# ================ Local version =====================
if-shell "[ -f ~/.tmux_local.conf ]" 'source ~/.tmux_local.conf'
set-option -g default-command "reattach-to-user-namespace -l zsh" # or bash
set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL"
# List of plugins
# Supports `github_username/repo` or full git repo URLs
run -b '~/.tmux/plugins/tpm/tpm'