-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
93 lines (65 loc) · 2.61 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
set-environment -g PATH "/usr/local/bin:/bin:/usr/bin"
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# remap C-b to C-a
set -g prefix C-a
# tmux messages are displayed for 4 seconds
set -g display-time 4000
# 256 terminal colors
set -g default-terminal "screen-256color"
# no delay for esc key
set -s escape-time 50
# more scrollback
set-option -g history-limit 3000
# split panes using | and -
# (and open new panes & windows in current directory)
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
unbind '"'
unbind %
# Smart pane switching with awareness of Vim splits & FZF
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
bind -n C-h run "($is_vim && tmux send-keys C-h) || \
tmux select-pane -L"
bind -n C-j run "($is_vim & tmux send-keys C-j) || \
($is_fzf && tmux send-keys C-j) || \
tmux select-pane -D"
bind -n C-k run "($is_vim && tmux send-keys C-k) || \
($is_fzf && tmux send-keys C-k) || \
tmux select-pane -U"
bind -n C-l run "($is_vim && tmux send-keys C-l) || \
tmux select-pane -R"
bind -n 'C-\' if-shell "$is_vim" "send-keys C-\\\\" "select-pane -l"
# prefix + C-l to clear console (b/c C-l is remapped above)
bind C-l send-keys 'C-l'
# status bar colors
set-option -g status-interval 1
set -g status-style bg='#44475a',fg='#bd93f9'
set -g status-left '#[bg=#f8f8f2]#[fg=#282a36]#{?client_prefix,#[bg=#ff79c6],}'
set -g message-style bg='#44475a',fg='#8be9fd'
# Enable mouse mode
set -g mouse on
# don't rename windows automatically
set-option -g allow-rename off
# loud or quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
## Plugins
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'xamut/tmux-spotify'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Status bar w/ time & battery percentage
set -g status-right '%H:%M:%S #[fg=blue]%a %d-%m-%y W%V |#{battery_status_bg} Batt #{battery_percentage} '
# tmux resurrect
set -g @resurrect-strategy-nvim 'session'
## Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'