-
Notifications
You must be signed in to change notification settings - Fork 1
tmux
I used to use screen. Now I use tmux.
Benefits include:
- A reasonable config file.
- Reasonable splits
See my tmux.conf for annotated configs
-
:capture-pane -S -500
- yank 500 lines to a buffer -
:save-buffer filename.txt
- write buffer contents to file
NOTE: copying to system pasteboard is constantly broken everytime a new version of tmux comes out, and it is infuriating, and is seriously making me think of never updating tmux again, or going back to GNU screen
Use vi mode. In tmux.conf:
setw -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
Then, <prefix> [
to enter copy mode. You can vim around, v
to get visual, y
to yank. Then, <prefix> p
to put.
<prefix> #
to view buffers you've yanked to.
When typing, <prefix> =
followed by buffer number/letter n
to paste from that buffer.
If you attach to a monitor, or resize your font or something, tmux might keep the size of your smaller laptop screen because it by default preserves the dimensions of the smallest screen across all sessions to which the window is attached. To fix this either-
- Detach, and
tmux attach -d
, or -
<prefix> D
(that is, Prefix + Big D) and select the session with the smaller dimensions to detach.
usage:
tmux send-keys -t <target> '...'
example:
tmux send-keys -t 1 '(load "wumpus.cl")' c-m
src: https://minimul.com/increased-developer-productivity-with-tmux-part-5.html
bind-key ! break-pane -d -n coolname
bind-key @ join-pane -s $.0
- shortcuts and cheatsheet: https://gist.github.com/MohamedAlaa/2961058
- https://leanpub.com/the-tao-of-tmux/read