Chapter 4: Working With Text and Buffers
Chapter Overview
Topics covered:
-
Scrolling through output (copy mode)
-
Selecting and copying text
-
Working with multiple paste buffers
-
System clipboard integration
Key Concepts
Copy Mode
# Enter copy mode
<prefix> [
# Exit copy mode
q or Escape
Vi vs Emacs Mode
# Set vi mode in config
set-window-option -g mode-keys vi
Selection in Vi Mode
# Start selection
Space (or v)
# Copy selection
Enter (or y)
# Rectangle selection
Ctrl+v
Paste Buffers
# Paste most recent
<prefix> ]
# Choose buffer to paste
<prefix> =
# List buffers
tmux list-buffers
Exercises
Exercise 4.1: Copy Mode Navigation
-
Enter copy mode
-
Navigate using vi keys (h,j,k,l)
-
Jump to top/bottom of buffer
-
Search for text
-
Exit copy mode
# Key sequence practiced:
Exercise 4.2: Text Selection and Copy
-
Run a command with output (e.g.,
ls -la) -
Enter copy mode
-
Select multiple lines
-
Copy selection
-
Paste in another pane
# Key sequence practiced:
Exercise 4.3: System Clipboard Integration
Configure tmux to work with system clipboard:
# For Linux (X11)
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -selection clipboard"
# For Linux (Wayland)
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy"
# Your config:
Exercise 4.4: Multiple Buffers
-
Copy different text snippets to separate buffers
-
List all buffers
-
Paste from a specific buffer
-
Delete a buffer
# Commands used:
Notes
Write your observations, insights, and questions here as you read.
Config Ideas
Copy/paste settings for quantum config:
# Ideas for dots-quantum/tmux/.config/tmux/tmux.conf
# Vi mode
set-window-option -g mode-keys vi
# Clipboard integration (Wayland - your setup)
Chapter Completed
-
Read chapter
-
Mastered copy mode navigation
-
Configured clipboard integration
-
Practiced buffer management
Date completed: _