-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
134 lines (111 loc) · 5.47 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Make Ctrl+Space the prefix key
unbind C-b
set -g prefix C-Space
bind Space send-prefix
# improve colors
set -g default-terminal 'screen-256color'
set-window-option -g utf8 on
###############################################################################
###############################################################################
### Awesome copy and paste
###############################################################################
###############################################################################
# User vim keybindings
# For a full list, open the tmux command line with <prefix> :
# and issue list-keys -t vi-copy
set-window-option -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
###############################################################################
###############################################################################
### Vim Resizing
###############################################################################
###############################################################################
# resize panes like vim
bind -r < resize-pane -L 5
bind -r > resize-pane -R 5
bind -r - resize-pane -D 5
bind -r + resize-pane -U 5
###############################################################################
###############################################################################
### Vim Movement Across Panes
###############################################################################
###############################################################################
# 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"
###############################################################################
###############################################################################
### Better Window Management
###############################################################################
###############################################################################
# create a new window with prefix + n
bind-key -r n new-window -c "#{pane_current_path}"
# create a new horizontal split pane with prefix + c
bind-key -r h split-window -v -c "#{pane_current_path}"
# create a new vertical split pane with prefix + p
bind-key -r v split-window -h -c "#{pane_current_path}"
# go to the previous window
bind-key p last-window
###############################################################################
###############################################################################
### Status bar
###############################################################################
###############################################################################
#
set -g status-bg black
set -g status-fg white
set -g window-status-bg black
set -g window-status-current-fg yellow
set -g status-interval 10
set -g status-left-length 50
###############################################################################
###############################################################################
### Message bar
###############################################################################
###############################################################################
set -g message-attr bright
set -g message-bg black
set -g message-fg blue
set -g display-time 2000
set -g display-panes-time 2000
###############################################################################
###############################################################################
### Automatically set window title
###############################################################################
###############################################################################
set-window-option -g automatic-rename on
set-option -g set-titles on
###############################################################################
###############################################################################
### Window Numbering
###############################################################################
###############################################################################
# Start Window Numbers at 1
set -g base-index 1
set-window-option -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
###############################################################################
###############################################################################
### Misc
###############################################################################
###############################################################################
# remove administrative debris (session name, hostname, time) in status bar
set -g status-left ''
set -g status-right 'arcin'
# increase scrollback to 10,000 lines
set -g history-limit 10000
# No delay for escape key press
set -sg escape-time 0
# Reload tmux config
# bind r source-file ~/.tmux.conf
bind r source-file ~/.tmux.conf \; display-message "Configuration reloaded."