-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
114 lines (86 loc) · 3.1 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
###########################
# Configuration
###########################
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",*256col*:Tc"
# use vim key bindings
setw -g mode-keys vi
# increase scroll-back history
set -g history-limit 10000
# start window index at 1
set -g base-index 1
# start pane index at 1
setw -g pane-base-index 1
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
# re-number windows when one is closed
set -g renumber-windows on
# mouse support
set-option -g -q mouse on
# tweak escape time https://github.com/neovim/neovim/wiki/FAQ
set -sg escape-time 10
# tmux base16-shell fix, see: https://github.com/base16-project/base16-shell/issues/5
set -g allow-passthrough on
# if having issues with your other programs dependent on TERM env variable
# set -g default-terminal screen-256color
# enable pbcopy and pbpaste
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/blob/master/README.md
set-option -g default-command "reattach-to-user-namespace -l zsh"
###########################
# Key Bindings
###########################
# tmux prefix
unbind C-b
set -g prefix C-y
# copy selection to macos clipboard
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
# paste
unbind C-p
bind C-p paste-buffer
# window splitting
unbind %
bind v split-window -h -c "#{pane_current_path}"
unbind '"'
bind h split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# 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"
# os-x maps ctrl-arrow already, so single cell resizes
# will be prefix shift-arrow instead to prevent the conflict.
bind -r S-Right resize-pane -R 1
bind -r S-Left resize-pane -L 1
bind -r S-Up resize-pane -U 1
bind -r S-Down resize-pane -D 1
###########################
# Status Bar
###########################
# set refresh interval for status bar
set -g status-interval 30
# center the status bar
set -g status-justify left
# show session, window, pane in left status bar
set -g status-left-length 40
set -g status-left '#[fg=green]#S #[default]'
# show hostname, date and time in right status bar
set -g status-right-length 60
set-option -g status-right ''
###########################
# Colors
###########################
# default statusbar colors
set -g status-style bg=default,fg=white
# highlight current window
set-window-option -g window-status-current-style bg=green,fg=black
# # pane border
set-option -g pane-border-style fg=brightgreen #base02
set-option -g pane-active-border-style fg=brightgreen #base01