A tmux plugin inspired by flash.nvim that enables you to search visible words in the current tmux pane, then copy that word, or a ranged selection, to the system clipboard by pressing the associated label key.
Features
- Dynamic Search: Type to filter words in real-time as you search.
- Overlay Labels: Single key selection with labels overlayed on matches in the pane.
- Dimmed Display: Non-matching content is dimmed for visual focus.
- Clipboard Copy: Selected text is immediately copied to the system clipboard.
- Auto-paste Modifier: Use semicolon key as a modifier to automatically paste selected text.
- Configurable Word Boundaries: Honours tmux's
word-separatorsby default, with override support.
Demonstrations
Single word copy
Tip
You can auto-paste your selected match by using the ; (semicolon) modifier key.
See the Auto-paste text section for more details.
Range copy
Tip
Range mode can copy multiple lines of text, above or below the first marker. See the Copy a range section for the full flow.
Table of contents
- Requirements
- Installation
- Usage
- Configuration
- Clipboard implementation
- Debugging
- Development and testing
- Demonstration configuration
- Contributing
- Inspiration
- Other plugins
Requirements
Installation
Using TPM Redux (recommended)
-
Install TPM Redux (Tmux Plugin Manager).
-
Add
tmux-flash-copyto your~/.tmux.conf:set -g @plugin 'kristijan/flash-copy.tmux'
-
Start tmux and install the plugin.
Press
<tmux_prefix> + I(capital i, as in Install) to install the plugin.Press
<tmux_prefix> + U(capital u, as in Update) to update the plugin.
Manual installation
-
Clone this repository to your desired location:
git clone https://github.com/kristijan/flash-copy.tmux.git ~/.tmux/plugins/flash-copy.tmux -
Add the following to your
~/.tmux.conf:run-shell ~/.tmux/plugins/flash-copy.tmux/tmux-flash-copy.tmuxDefine any customisation options before the
run-shellline so they are loaded correctly.For example:
set -g @flash-copy-bind-key "f" set -g @flash-copy-prompt-indicator "❯" run-shell ~/.tmux/plugins/flash-copy.tmux/tmux-flash-copy.tmux
-
Reload your tmux configuration:
tmux source-file ~/.tmux.conf
Usage
- Press the bind key (default:
<tmux_prefix> F, or<tmux_prefix> Shift+f) to activate the search. - Type to search for words in the pane. The search is dynamic and updates as you type.
- Matching words will be highlighted in yellow with single-character labels in green.
- Press a label key. In the default word mode, its word is copied immediately. In range mode, it pins the first endpoint so you can search for and select the second.
- The completed word or range is copied to your clipboard and the search closes.
Keybindings when search is active
| Keybinding | Action |
|---|---|
Ctrl+U |
Clear the entire search query |
Ctrl+W |
Clear the previous word |
Enter |
Select the first match (determined by @flash-copy-reverse-search setting) |
;+<label> |
Copy and auto-paste the word or completed range (if auto-paste enabled) |
,+<label> |
Use the copy mode opposite to @flash-copy-mode for this selection |
Ctrl+C / ESC |
Cancel and close the search without copying |
Auto-paste text
By default, selecting a label will copy the text to the clipboard only. If auto-paste is enabled (the default), you can also paste the text automatically:
- Hold
;(semicolon) (orShift+;(colon) for uppercase labels) to activate the auto-paste modifier - Then press the label key to paste a specific word, or
Enterto paste the first match
The selected text is copied to the clipboard and automatically pasted into your pane.
Copy a range
Range selection copies both separator-defined endpoint words and everything between them:
- Search for the first endpoint.
- Press
,(comma) to switch from the default word mode to range mode, then select its label. You can also press,followed byEnterto use the first match. - The first endpoint remains pinned with black text on a solid magenta block and the query clears.
- Search for an endpoint anywhere above or below the first one.
- Select its label, or press
Enter, to copy all text between the two endpoints.
Set @flash-copy-mode to range to start every invocation in range mode. The first label or Enter then pins the first endpoint without requiring comma. In this mode, comma switches the selection back to a one-off word copy.
For example, endpoints shown as he<M1>lo w<M2>rld copy hello world. The entire word hello is highlighted while the second endpoint is pending. Separators outside the endpoint words are excluded, while separators and newlines between those words are preserved.
Set @flash-copy-range-copy-mode to precise to include the complete search query at each endpoint instead of expanding to whole words. In the same example, precise mode copies hello w and highlights the complete first query, he, while the second endpoint is pending. Press ; before the second label or Enter to copy and auto-paste the completed range.
The mode-switch key is searchable during the second search. To search for it during the first search, disable range selection or configure a different key.
Configuration
See Configuration for supported options, defaults, and ANSI colour codes.
Clipboard implementation
See Clipboard implementation for clipboard methods, troubleshooting, and platform-specific recommendations.
Debugging
See the Debugging guide for the log format, troubleshooting advice, and example debug sessions.
Development and testing
See the Testing guide to set up a development environment and run tests and code-quality checks.
See the Release guide for the versioning, validation, tagging, and publication checklist.
Demonstration configuration
The following configuration is used in the demonstration GIF.
set -g @plugin 'kristijan/flash-copy.tmux' set -g @flash-copy-prompt-indicator "❯" set -g @flash-copy-prompt-colour "\033[38;2;203;166;247m"
Terminal setup
- Font is MonaspiceAr Nerd Font Mono
- Shell prompt is starship
- tmux status bar and theme is tmux-powerkit
- bat theme is catppuccin mocha.
Contributing
Contributions are welcome. Feel free to submit issues or pull requests.
Before submitting a PR:
- Run tests and code quality checks (see the Testing guide).
- Ensure all tests pass.
- Add tests for new functionality.
- Update documentation as needed.
Inspiration
This plugin is inspired by the excellent flash.nvim plugin for Neovim, adapted for the tmux ecosystem.
Other plugins
Check out my other plugin, TMUX FZF Pane Switch, which lets you find and switch to any pane in any session using fzf.

