-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathtmux.conf
119 lines (89 loc) · 3.27 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
115
116
117
118
119
# Copied from Daniel Nolan's dotfile repo
# remap prefix to Control + a
set -g prefix C-f
unbind C-b
bind ` send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# Use shell set as SHELL env variable
set-option -g default-shell $SHELL
# quick pane cycling
unbind ^F
bind ^F select-pane -t :.+
#new 25% vertical split pane
bind ^T split-window -p 25
#start window index at 1
#set -g base-index 1
# lower the delay between the prefix key and other keys (fixes pause when using vim)
set -sg escape-time 1
# act like vim in copy mode
setw -g xterm-keys
setw -g mode-keys vi
# Setup 'v' to being selection as in Vim
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# Update default binding of `Enter` to also use copy-pipe
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
#select panes with <Prefix> h, j, k, l
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# cycle windows with C-h and C-l
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# default terminal
set -g default-terminal "screen-256color"
set -g history-limit 5000
#rebind pane splitting
bind | split-window -h
bind - split-window -v
# By default show sessions with windows (and panes) collapsed when listing sessions
bind-key 'w' choose-tree -Zs
# set window notifications
setw -g monitor-activity on
set -g visual-activity on
# Constrain the window size to the size of the smallest client's window, if that
# client is looking at it
setw -g aggressive-resize on
# resize panes
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
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"
# dont auto-name my windows!
setw -g automatic-rename off
# Turn mouse on with leader m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# Turn mouse off with leader M
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
# Colors
set-option -g status-style fg=colour7,bg=colour0,default
# default window title fg, bg, and attribute
setw -g window-status-style fg=colour10,bg=default,default
# current window title
setw -g window-status-current-style fg=colour2,bg=default
set-option -g pane-border-style fg=colour10,bg=default
set-option -g pane-active-border-style fg=colour51,bg=colour254
set-option -g message-style fg=colour7,bg=colour1
set -g display-panes-active-colour colour33
set -g display-panes-colour colour166
setw -g clock-mode-colour colour64
set -g status-left-length 40
set -g status-left "#[fg=colour10]Session: #S"
set -g status-right "#[fg=colour10][%m/%d/%Y %l:%M%p]"
set -g status-justify centre # center window list