tmux-autocomplete is an addon for tmux that allows to interactively complete various strings from current output (pane) using string under cursor as prefix.
tmux-autocomplete can be also used as url-opener since it can match arbitrary strings in output and run specified command, for example, browser.
Power of tmux-autocomplete comes from the fact that it is working on top of tmux, which means that it can complete strings for any program running in terminal, including remote ssh sessions.
tmux-autocomplete significantly reduces need of use mouse when working in terminal by providing an easy way of inserting parts of outputs of previous commands back.
If you ever selected text in your terminal with mouse just for inserting it back for next command in shell, then tmux-autocomplete is for you.
The only requirement for using tmux-autocomplete is tmux itself.
Yes, but you must install tmux, then you need to add simple tmux configuration in your ~/.tmux.conf file (create if doesn't exist):
set -g prefix C-Space
bind-key C-Space run -b 'tmux-autocomplete'
After that you can download and install tmux-autocomplete.
Then open new terminal and run tmux then you can type some string, invoke completion by pressing Control+Space twice in a row. Tmux-autocomplete will be spawned and will find completion for inserted prefix automatically.
Once you downloaded the package for your OS, you need to install it using your system package manager.
sudo installer -pkg tmux-autocomplete_2.0.6.gba9f4dd.pkg -target / -verbose
Or just double click on the downloaded file using File Manager.
With dpkg:
sudo dpkg -i tmux-autocomplete_2.0.5.gc0658bf.deb
sudo pacman -U tmux-autocomplete_2.0.5.gc0658bf.pkg.tar.xz
With rpm:
sudo rpm -i tmux-autocomplete_2.0.5.gc0658bf.rpm
tmux-autocomplete invoked by using key combination that should specified
in your ~/.tmux.conf, like this:
set -g prefix C-Space
bind-key C-Space run -b 'tmux-autocomplete'
If you have configuration like this, you can invoke completion of string under cursor in your terminal by hitting Control+Space twice in a row.
After tmux-autocomplete invoked and given that string under cursor can be completed by more than one string in scrollback, text in terminal go gray and available completion candidates will be higlighted.
Press h / Arrow Left , j / Arrow Down , k / Arrow Up , l / Arrow Right to select candidate.
Press Enter to insert selected candidate.
Press Control+C to interrupt current completion and go back without modifying text in your terminal.
tmux-autocomplete uses dark theme as default theme. You can switch
to light theme by changing binding in your ~/.tmux.conf:
bind-key C-Space run -b 'tmux-autocomplete --theme=light'
Add new binding in your ~/.tmux.conf, like this:
bind-key C-x run -b 'tmux-autocomplete-url'
Source configuration using tmux source ~/.tmux.conf .
Now you can select and open URL from output of terminal by pressing Control-X .
Check out following file in your system for some inspiration:
/usr/share/tmux-autocomplete/themes/light.theme
Although tmux-autocomplete is not open-source and require license file, it is free now for early adopters. If it will gain some traction, then it will be made paid to support following development and new features.
Please, write to we@reconquest.io to receive free license.
If something will go wrong, tmux-autcomplete will print debug messages back to terminal. If you will encounter such situation, please copy output and contact support for additional help.
It works, make sure that you are passing flag -b to run command in
your tmux.conf, like as following:
bind-key C-Space run -b 'tmux-autocomplete'