• Stars
    star
    631
  • Rank 71,222 (Top 2 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 10 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tmux key bindings for quick opening of a highlighted file or url

Tmux open

Plugin for opening highlighted selection directly from Tmux copy mode.

Tested and working on Linux, OSX and Cygwin.

Key bindings

In tmux copy mode:

  • o - "open" a highlighted selection with the system default program. open for OS X or xdg-open for Linux.
  • Ctrl-o - open a highlighted selection with the $EDITOR
  • Shift-s - search the highlighted selection directly inside a search engine (defaults to google).

Examples

In copy mode:

  • highlight file.pdf and press o - file will open in the default PDF viewer.
  • highlight file.doc and press o - file will open in system default .doc file viewer.
  • highlight http://example.com and press o - link will be opened in the default browser.
  • highlight file.txt and press Ctrl-o - file will open in $EDITOR.
  • highlight TypeError: 'undefined' is not a function and press Shift-s - the text snipped will be searched directly inside google by default

Screencast

screencast screenshot

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.

Manual Installation

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.

Configuration

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.

How can I change the default search engine to "duckduckgo" or any other one?

Put set -g @open-S 'https://www.duckduckgo.com/?q=' in tmux.conf

How can I use multiple search engines?

Put:

set -g @open-B 'https://www.bing.com/search?q='
set -g @open-S 'https://www.google.com/search?q='

in tmux.conf

Other goodies

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

License

MIT

More Repositories

1

tpm

Tmux Plugin Manager
Shell
12,082
star
2

tmux-resurrect

Persists tmux environment across system restarts.
Shell
11,249
star
3

tmux-continuum

Continuous saving of tmux environment. Automatic restore when tmux is started. Automatic tmux start when computer is turned on.
Shell
3,263
star
4

tmux-yank

Tmux plugin for copying to system clipboard. Works on OSX, Linux and Cygwin.
Shell
2,682
star
5

tmux-sensible

basic tmux settings everyone can agree on
Shell
1,756
star
6

list

A list of tmux plugins.
1,201
star
7

tmux-copycat

A plugin that enhances tmux search
Shell
1,103
star
8

tmux-logging

Easy logging and screen capturing for Tmux.
Shell
1,034
star
9

tmux-pain-control

standard pane key-bindings for tmux
Shell
755
star
10

tmux-prefix-highlight

Plugin that highlights when you press tmux prefix key
Shell
571
star
11

tmux-sidebar

A sidebar with the directory tree for the current path. Tries to make tmux more IDE like.
Shell
536
star
12

tmux-battery

Plug and play battery percentage and icon indicator for Tmux.
Shell
499
star
13

tmux-cpu

Plug and play cpu percentage and icon indicator for Tmux.
Shell
433
star
14

tmux-sessionist

Lightweight tmux utils for manipulating sessions
Shell
412
star
15

vim-tmux-focus-events

Make terminal vim and tmux work better together.
Vim Script
348
star
16

vim-tmux

vim plugin for tmux.conf
Vim Script
333
star
17

tmux-fpp

Quickly open any path on your terminal window in your $EDITOR of choice!
Shell
308
star
18

tmux-urlview

Quickly open any url on your terminal window!
Shell
266
star
19

tmux-online-status

Tmux plugin that displays online status of your computer.
Shell
169
star
20

tmux-example-plugin

Example Tmux plugin that actually demonstrates how to build plugins for Tmux. The accompanying tutorial is here: https://github.com/tmux-plugins/tpm/blob/master/HOW_TO_PLUGIN.md
Shell
45
star
21

tmux-cowboy

Kill hanging processes fast
Shell
37
star
22

tmux-maildir-counter

Plugin that counts files on a specific mail directory
Shell
32
star
23

tmux-test

A small framework for isolated testing of tmux plugins.
Shell
16
star
24

language-tmux

Atom language support for Tmux config file
CoffeeScript
10
star
25

tmux-newsboat

Display newsboat counters in tmux status line.
Shell
10
star