-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux_notes.txt
147 lines (117 loc) · 4.69 KB
/
tmux_notes.txt
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
* Tmux configuration
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Ctrl-b the prefix that sends a keybinding to tmux instead of to the shell or program running in tmux.
Ctrl-b c create a new window.
Ctrl-b " split the window horizontally.
Ctrl-b % split the window vertically.
Ctrl-b s list sessions.
Ctrl-b d detach a session.
Ctrl-b [ start copy.
Ctrl-Space start selection.
Ctrl-w copy text from selection.
Ctrl-b ] paste.
Ctrl-b w select from windows.
Ctrl-b l last window.
Ctrl-b n next window.
Ctrl-b : command mode.
===
General
----------
? = List all key bindings.
d = Detach the current client.
: = Enter the tmux command prompt.
Creating/Managing windows
-------------------------
c = Create a new window
n = Change to the next window.
p = Change to the previous window.
l = Move to the previously selected window.
0-9 = Select windows 0 to 9.
' = Prompt for a window index to select. Then enter a number or title to switch to that window.
,= Rename the current window.
w = Choose the current window interactively.
:, then type list-windows enter = Display the list of windows.
& = Closes the current window after prompting for confirmation.
% = Divides the current window in half vertically.
" = Divides the current window in half horizontally
Creating/Managing panes
------------------------------
" = Split the current pane into two, top and bottom.
% = Split the current pane into two, left and right.
o = Select the next pane in the current window.
; = Move to the previously active pane.
{ = Swap the current pane with the previous pane.
} = Swap the current pane with the next pane.
Ctrl+o = Rotate the panes in the current window forwards.
Alt+1 to Alt+5 = Arrange panes in one of the five preset layouts: even-horizontal, even-vertical, main-horizontal, main-vertical, or tiled.
x = Kill the current pane.
! = Break the current pane out of the window.
q = display-panes
Prefix o = Cycles through open panes.
Prefix q = Momentarily displays pane numbers in each pane.
Prefix x = Closes the current pane after prompting for confirmation.
Prefix Space = Cycles through the various pane layouts.
Copy, Paste and Scroll operations
-------------------------------------------------------------
The keys available depend on whether emacs (default) or vi mode is selected. The mode-keys option can be set int .tmux.conf for vi mode.
[ = Enter copy mode to copy text or view the history.
] = Paste the most recently copied buffer of text.
# = List all paste buffers.
- = Delete the most recently copied buffer of text.
Switch between sessions:
--------------------------------------
C-a ( previous session
C-a ) next session
C-a L ‘last’ (previously used) session
C-a s choose a session from a list
tmux new -s session_name - creates a new tmux session named session_name
tmux attach -t session_name - attaches to an existing tmux session named session_name
tmux switch -t session_name - switches to an existing session named session_name
tmux list-sessions - lists existing tmux sessions
tmux detach (prefix + d) - detach the currently attached session
tmux kill-session -t myname
prefix + z to maximize pane to the entire window
* Sample configuration
====================
File~/.tmux.conf
set -g default-terminal "screen-256color" # use 256 colors
set -g status-utf8 on # enable utf-8
set -g history-limit 100000 # scrollback buffer n lines
# start window indexing at one instead of zero
set -g base-index 1
# set the prefix key and some key bindings to match GNU Screen
set -g prefix C-a
bind-key C-a last-window
# key bindings for horizontal and vertical panes
unbind %
bind | split-window -h
bind - split-window -v
# enable window titles
#set -g set-titles on
# window title string (uses statusbar variables)
set -g set-titles-string '#T'
# status bar with load and time
set -g status-bg '#4e4e4e'
set -g status-fg '#ffffff'
set -g status-left ' '
set -g status-right '#[bg=#bbbbbb]#[fg=#000000]#(cut -d " " -f -3 /proc/loadavg) #[bg=#4e4e4e]#[fg=#ffffff]#(
date +" %H:%M ")'
set -g window-status-format '#I #W'
set -g window-status-current-format ' #I #W '
setw -g window-status-current-bg '#55ff55'
setw -g window-status-current-fg '#000000'
# pane border colors
set -g pane-active-border-fg '#bbbbbb'
set -g pane-border-fg '#555555'
# bind to reload config
bind r source-file ~/.tmux.conf
=====================================
* tmuxifier
*** git clone https://github.com/jimeh/tmuxifier.git ~/.tmuxifier
Then add $HOME/.tmuxifier/bin to your PATH to make the tmuxifier
executable available to you:
export PATH="$HOME/.tmuxifier/bin:$PATH"
[[https://github.com/jimeh/tmuxifier][Tmuxifier github ]]
Updating:
cd ~/.tmuxifier # or where you've cloned tmuxifier to
git pull