-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
94 lines (76 loc) · 2.88 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
# set prefix to ctrl+s
unbind C-b
set -g prefix C-s
# enable mouse scroll
setw -g mouse on
# remove ESC key delay for better vim'ing
set -sg escape-time 0
# bind r to reload tmux config
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# bind h & v to split window
bind-key v split-window -h -c '#{pane_current_path}'
bind-key h split-window -v -c '#{pane_current_path}'
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"
# visual selection/copy
setw -g mode-keys vi
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# 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
bind -n C-Left resize-pane -L 10
bind -n C-Right resize-pane -R 10
bind -n C-Down resize-pane -D 5
bind -n C-Up resize-pane -U 5
# arrows to switch windows
bind-key Left previous-window
bind-key Right next-window
# Shift+arrows to switch windows
bind-key -n S-Left previous-window
bind-key -n S-Right next-window
# Shift+Alt+arrows to reorder windows
bind-key -n M-S-Left swap-window -t -1
bind-key -n M-S-Right swap-window -t +1
# automatically set window title
setw -g automatic-rename on
set-option -g set-titles on
# set window and pane numbering to start at 1
set -g base-index 1
setw -g pane-base-index 1
# Add truecolor support
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Default terminal is 256 colors
set -g default-terminal "screen-256color"
# constrain window size to maximum size of any client
# connected to *that* window
setw -g aggressive-resize on
# Make new windows open to the current path instead
# of the path tmux was started from
bind c new-window -c "#{pane_current_path}"
# THEME
set -g status-bg "#44475a"
set -g status-fg "#f8f8f2"
set -g status-left-length 100
set -g status-left " #[fg=#ff79c6]♥︎ #[fg=#6272a4]| #[fg=#50fa7b,bold]#S"
set -g status-right-length 0
set -g status-right ""
set -g status-justify right
setw -g window-status-format '#[fg=default]#I|#[fg=default]#W'
setw -g window-status-current-format '#[fg=#00ffff,bold]#I|#W'
set -g pane-border-style 'fg=#707070'
set -g pane-active-border-style 'fg=#ff79c6'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm'
set -g @continuum-restore 'on'
run '~/.tmux/plugins/tpm/tpm'