-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
133 lines (118 loc) · 4.78 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
# act like vim
set-option status-keys vi
setw -g mode-keys vi
# enable UTF8 for this session (set-option)
# set-option utf8 on
# use vim bindings to move through panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# use vim-ish bindings for resizing panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Default bindings:
# C-b Send the prefix key (C-b) through to the application.
# C-o Rotate the panes in the current window forwards.
# C-z Suspend the tmux client.
# ! Break the current pane out of the window.
# " Split the current pane into two, top and bottom.
# # List all paste buffers.
# $ Rename the current session.
# % Split the current pane into two, left and right.
# & Kill the current window.
# ' Prompt for a window index to select.
# , Rename the current window.
# - Delete the most recently copied buffer of text.
# . Prompt for an index to move the current window.
# 0 to 9 Select windows 0 to 9.
# : Enter the tmux command prompt.
# ; Move to the previously active pane.
# = Choose which buffer to paste interactively from a list.
# ? List all key bindings.
# D Choose a client to detach.
# [ Enter copy mode to copy text or view the history.
# ] Paste the most recently copied buffer of text.
# c Create a new window.
# d Detach the current client.
# f Prompt to search for text in open windows.
# i Display some information about the current window.
# l Move to the previously selected window.
# n Change to the next window.
# o Select the next pane in the current window.
# p Change to the previous window.
# q Briefly display pane indexes.
# r Force redraw of the attached client.
# s Select a new session for the attached client interactively.
# L Switch the attached client back to the last session.
# t Show the time.
# w Choose the current window interactively.
# x Kill the current pane.
# { Swap the current pane with the previous pane.
# } Swap the current pane with the next pane.
# ~ Show previous messages from tmux, if any.
# Page Up Enter copy mode and scroll one page up.
# Up, Down
# Left, Right
# Change to the pane above, below, to the left, or to the right of the current pane.
# M-1 to M-5 Arrange panes in one of the five preset layouts: even-horizontal, even-vertical, main-horizontal, main-vertical, or tiled.
# M-n Move to the next window with a bell or activity marker.
# M-o Rotate the panes in the current window backwards.
# M-p Move to the previous window with a bell or activity marker.
# C-Up, C-Down
# C-Left, C-Right
# Resize the current pane in steps of one cell.
# M-Up, M-Down
# M-Left, M-Right
# Resize the current pane in steps of five cells.
# use C-a as prefix (like GNU screen)
unbind C-b
set -g prefix C-a
# to pass C-a through to program running in tmux just do it twice
bind C-a send-prefix
# look good
set -g default-terminal "screen-256color"
# status bar
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-left-length 40
set -g status-right '#[fg=yellow]%Y-%m-%d %H:%M#[default] '
set -g status-left "#[fg=green]#S #[fg=yellow]#I #[fg=cyan]#P"
set -g status-utf8 on
set -g status-justify centre
setw -g monitor-activity on
set -g visual-activity on
# style the active window
setw -g window-status-current-fg yellow
setw -g window-status-current-bg black
setw -g window-status-current-attr bright
# Set the window and pane index to 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
# Set the pane divider colors
set -g pane-border-fg green
set -g pane-border-bg black
set -g pane-active-border-fg white
set -g pane-active-border-bg yellow
# reload this file
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# split panes
bind | split-window -h
bind - split-window -v
# copy and paste (command mode)
unbind [
bind Escape copy-mode
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# Use this wrapper function so pbcopy and pbpaste work in tmux
# NOTE: You need to install reattach-to-user-namespace pasteboard
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
set-option -g default-command "reattach-to-user-namespace -l zsh"
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "tmux set-buffer - $(reattach-to-user-namespace pbpaste); tmux paste-buffer"