-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
158 lines (123 loc) · 4.45 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#
# tmux configuration
#
# Prerequisites:
# `reattach-to-user-namespace`
# `tmux-vim-select-pane`
#
# Help:
# `tmux list-keys`
# `tmux list-commands`
# `tmux info`
#
# Thanks:
# @thoughtbot
# @mislav
#
# C-a as prefix instead of C-b
set -g prefix C-a
unbind C-b
# Bring back beginning-of-line under tmux prefix
bind C-a send-prefix
# Increase repeat-time for multiple commands to be entered without entering
# the prefix again (default: 500ms)
set -g repeat-time 700
# Increase scrollback lines (default: 2000)
set -g history-limit 10000
# Source this file after changes and output message in copy mode
bind R source-file ~/.tmux.conf \; run-shell "echo 'Sourced ~/.tmux.conf'"
# Faster escape sequences (default: 500ms)
# http://superuser.com/a/252717/65504
set -s escape-time 50
# Enable copy-paste http://goo.gl/DN82E
# Enable RubyMotion http://goo.gl/WDlCy
set -g default-command 'reattach-to-user-namespace -l bash'
###############################################################################
# Appearance
###############################################################################
# Support syntax highlighting in Vim
set -g default-terminal 'screen-256color'
# Display all colors:
#
# for i in {0..255}; do
# printf "\x1b[38;5;${i}mcolour${i}\n"
# done
#
# Can also use hex colors such as '#aaaaaa'
# Pane divider color
set -g pane-border-fg colour231
set -g pane-active-border-fg colour112
#
# Monokai status bar
#
set -g status-fg colour8
set -g status-bg colour234
# Current session
set -g status-left ' #S '
set -g status-left-length 15
set -g status-left-fg colour231
set -g status-left-bg colour106
# Window list
set -g window-status-format "#[fg=colour8] #I #[fg=colour231]#W#[fg=colour106]#F "
set -g window-status-current-format "#[fg=colour81,bg=colour125] #I #[fg=colour231]#W#[fg=colour228]#F "
set -g window-status-separator ""
# Update status every 20 seconds (default: 15)
set -g status-interval 20
###############################################################################
# Windows
###############################################################################
# Number windows from 1 instead of 0
set -g base-index 1
# Renumber windows sequentially after closing any of them
set -g renumber-windows on
# Disable programs changing window names via terminal escape sequence
set-window-option -g allow-rename off
# Select prev/next windows without letting go of prefix - reverse these since
# it's more intuitive when switching left/right
bind-key -r C-n select-window -t :-
bind-key -r C-p select-window -t :+
# Create a new windows without letting go of prefix and preserve the current
# pane path
bind-key -r C-c new-window -c "#{pane_current_path}"
# Remove window/pane without letting go of prefix - no confirmation prompt
# Don't do this because it's too dangerous
# bind-key -r C-x kill-pane
###############################################################################
# Panes
###############################################################################
# Move around panes with prefix C-h/j/k/l
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R
# Move around panes in tmux and Vim without prefix C-h/j/k/l
# Requires `tmux-vim-select-pane` script and tmux_navigator.vim
# https://gist.github.com/mislav/5189704
bind -n C-h run-shell 'tmux-vim-select-pane -L'
bind -n C-j run-shell 'tmux-vim-select-pane -D'
bind -n C-k run-shell 'tmux-vim-select-pane -U'
bind -n C-l run-shell 'tmux-vim-select-pane -R'
# Toggle active panes without prefix C-\
bind -n "C-\\" run-shell 'tmux-vim-select-pane -l'
# Bring back kill-line under tmux prefix
bind C-k send-keys 'C-k'
# Bring back clear screen under tmux prefix
bind C-l send-keys 'C-l'
# Resize panes without Alt/Option
bind-key -r Left resize-pane -L 3
bind-key -r Right resize-pane -R 3
bind-key -r Up resize-pane -U 2
bind-key -r Down resize-pane -D 1
# Override default pane splitting to preserve current pane path
bind-key % split-window -h -c "#{pane_current_path}"
bind-key '"' split-window -v -c "#{pane_current_path}"
###############################################################################
# Copy Mode
###############################################################################
# Vi mode keys
setw -g mode-keys vi
# Vi-like bindings for copy/paste
bind-key -t vi-copy 'v' begin-selection
# <Enter> in copy mode copies the text to system clipboard and exits copy mode
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe 'reattach-to-user-namespace pbcopy'