-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
100 lines (76 loc) · 2.79 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
# Copy/Paste
set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# Prefix Key
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Mouse support for switching panes/windows
# --Breaks copy/paste on OSX, hold option to disable(iTerm2)
setw -g mouse on
# vi mode
setw -g mode-keys vi
# Setting colors
set -g default-terminal "xterm-256color"
# Prevent auto-rename windows
set-option -g allow-rename off
# YES. A more sane way of window splits
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# Clear the terminal screen
bind C-l send-keys 'C-l'
# Make copy mode more vim-like.
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
# Activity Monitoring
setw -g monitor-activity off
set -g visual-activity off
# Shorten the delay
set -sg escape-time 0
# Resizing fix
setw -g aggressive-resize on
# Reload tmux configs easier
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Start windows at 1
set -g base-index 1
setw -g pane-base-index 1
# Navigation, 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)?$'"
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'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
#---- Neodark.vim
# default statusbar colors
set -g status-style bg=colour235,fg=colour6
# default window title colors
setw -g window-status-style bg=default,fg=colour15
# active window title colors
setw -g window-status-current-style bg=default,fg=red
# pane border
set -g pane-border-style fg=colour8
set -g pane-active-border-style fg=green
# message text
set -g message-style bg=colour235,fg=red
# modes
setw -g mode-style bg=colour11,fg=colour13,bold
# pane number display
set -g display-panes-active-colour green
set -g display-panes-colour blue
# clock
setw -g clock-mode-colour blue
# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red