A tmux plugin that provides emacs-style word completion with cycling functionality, similar to Alt+/ in emacs.
Features
- Word completion: Complete partial words by searching through all panes
- Cycling: Press the completion key multiple times to cycle through matches
- Scrollback support: Option to search through entire scrollback history
- Path component extraction: Handles both full paths and individual components
Installation
-
Clone this repository:
git clone https://github.com/machacd/tmux-complete ~/.tmux/plugins/tmux-complete -
Add this line to your
~/.tmux.conf:run-shell ~/.tmux/plugins/tmux-complete/tmux-completion.tmux -
Reload tmux configuration:
tmux source-file ~/.tmux.conf
Usage
Default Key Bindings
prefix + /- Complete word using visible pane contentprefix + ?- Complete word using entire scrollback history (larger word pool)
How It Works
- Type a partial word (e.g.,
test) - Press the completion key (e.g.,
prefix + /) - The word completes to the first match (e.g.,
testing_function) - Press the completion key again to cycle to the next match (e.g.,
test_variable) - Continue cycling through all available matches
Configuration
Custom Key Bindings
You can customize the key bindings by setting these options in your ~/.tmux.conf:
# Change the basic completion key (default: "/") set -g @completion_key "/" # Change the scrollback completion key (default: "?") set -g @completion_scrollback_key "?"
Word Matching
The plugin searches for words that:
- Contain alphanumeric characters, underscores, dots, slashes, hyphens, and equals signs
- Are at least 2 characters long
- Start with your typed partial word
It extracts both:
- Full paths:
/home/user/file.txt - Components:
home,user,file,txt
Performance
- Visible content: Fast, searches only currently visible pane content
- Scrollback content: Slower but comprehensive, searches entire history
Requirements
- tmux 2.0+
- bash
- Standard Unix utilities (grep, sed, awk)
License
MIT License - see LICENSE file for details.
TODO
- Show word search time in the status bar
- Sort words in cycle by order of appearance
