-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
58 lines (46 loc) · 1.75 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
# set new prefix C-b
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# tmux split pane shortcuts
bind-key _ split-window -v -c '#{pane_current_path}'
bind-key \ split-window -h -c '#{pane_current_path}'
# tmux plugins
set -g @plugin 'tmux-plugins/tmux-resurrect'
# for vim
set -g @resurrect-strategy-vim 'session'
# Pane resizing
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
# new window with current pane path
bind c new-window -c '#{pane_current_path}'
# set a Ctrl-b shortcut for reloading your tmux config
bind r source-file ~/.tmux.conf \; display-message "~/.tmux_conf reloaded"
# set colors in tmux windows
set -g default-terminal "screen-256color"
# Status bar customization
set -g status-utf8 on
set -g status-bg black
set -g status-fg '#aaaaaa'
set -g status-interval 5
set -g status-left-length 90
set -g status-right-length 60
set -g status-left "#[fg=Green]#(whoami)#[fg=white]::#[fg=blue]#(hostname -s)#[fg=white]::#[fg=yellow]#(curl ipecho.net/plain;echo)#[fg=white]::"
set -g status-justify left
set -g status-right '#[fg=Cyan]#S #[fg=white]%a %d %b %R'
# 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 indexing
set -g base-index 1
set -g renumber-windows on
# break current pane into new window
bind-key b break-pane -d
# run TPM
run '~/.tmux/plugins/tpm/tpm'