Plugin for opening highlighted selection directly from Tmux copy mode.
Tested and working on Linux, OSX and Cygwin.
In tmux copy mode:
o- "open" a highlighted selection with the system default program.openfor OS X orxdg-openfor Linux.O- "peek" a highlighted selection with the system default program.qlmanage(quicklook) for OS X (unsupported on Linux, at the moment).Ctrl-o- open a highlighted selection with the$EDITOR
In copy mode:
- highlight
file.pdfand presso- file will open in the default PDF viewer. - highlight
file.docand presso- file will open in system default.docfile viewer. - highlight
http://example.comand presso- link will be opened in the default browser. - highlight
file.txtand pressCtrl-o- file will open in$EDITOR.
Installation with Tmux Plugin Manager (recommended)
Add plugin to the list of TPM plugins in .tmux.conf:
set -g @plugin 'tmux-plugins/tmux-open'
Hit prefix + I to fetch the plugin and source it. You should now be able to
use the plugin.
Clone the repo:
$ git clone https://github.com/tmux-plugins/tmux-open ~/clone/path
Add this line to the bottom of .tmux.conf:
run-shell ~/clone/path/open.tmux
Reload TMUX environment:
# type this in terminal
$ tmux source-file ~/.tmux.conf
You should now be able to use the plugin.
How can I change the default "o" key binding to something else? For example, key "x"?
Put set -g @open 'x' in tmux.conf.
How can I change the default "Ctrl-o" key binding to "Ctrl-x"?
Put set -g @open-editor 'C-x' in tmux.conf.
tmux-open works great with:
- tmux-copycat - a plugin for regex searches in tmux and fast match selection
- tmux-yank - enables copying highlighted text to system clipboard
