-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
87 lines (69 loc) · 2.42 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
# ~/.tmux.conf
# Settings {{{
# Mouse mode
set -g mouse on
# Enable true colours
set -ga terminal-overrides ",xterm-256color:Tc"
set -g base-index 1
set-window-option -g pane-base-index 1
# Renumber windows automatically after removing a window
set-option -g renumber-windows on
# }}}
# Session restoring {{{
# Last saved environment is automatically restored when tmux is started
set -g @continuum-restore on
# Additional processes to resurrect
set -g @resurrect-processes 'weechat'
# }}}
# Bindings {{{
# Remap prefix to ctrl-space
unbind C-b
set -g prefix C-Space
# Use Vi style key bindings to move around copy mode
setw -g mode-keys vi
# Reload Tmux config
bind-key R source-file ~/.tmux.conf
# Toggle activity monitoring
bind-key m set-window-option monitor-activity
# Create a new session from current pane path
bind-key v new-session -c "#{pane_current_path}"
# }}}
# Status bar {{{
# Show the status line
set -g status on
# Styles
set-option -g message-style bg=blue,fg=brightwhite
set-option -g status-style bg=black,fg=white
set-option -g status-left-style bold
# Increase the length of left status so it's not truncated
set -g status-left-length 20
set -g status-right-length 50
set -g status-right "#(rainbarf --no-battery --no-remaining --rgb --width 20) #{battery_icon} #{battery_percentage} %H:%M %d-%b-%y"
# }}}
# {{{ Vim Tmux Navigator
# Smart pane switching with awareness of vim splits
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# }}}
# {{{ Tmux Plugin Manager
# List of plugins
# Supports `github_username/repo` or full git repo URLs
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-battery \
tmux-plugins/tmux-yank \
tmux-plugins/tmux-open \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-continuum \
tmux-plugins/tmux-sessionist \
nhdaly/tmux-scroll-copy-mode \
'
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'
# }}}