• Stars
    star
    1,103
  • Rank 42,076 (Top 0.9 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

A plugin that enhances tmux search

Tmux copycat

Build Status

NOTE: tmux 3.1 adds support for native regex searches. This is great news because it means a big part of 'tmux-copycat' is now available natively! Use this plugin only if you need its other features.

This plugin enables:

  • regex searches (native support added in tmux 3.1)
  • search result highlighting
  • predefined searches

Predefined searches are plugin killer feature. It speeds the workflow and reduces mouse usage with Tmux.

It works even better when paired with tmux yank. Tested and working on Linux, OSX and Cygwin.

Screencast

screencast screenshot

Search

  • prefix + / - regex search (strings work too)

Example search entries:

  • foo - searches for string foo
  • [0-9]+ - regex search for numbers

Grep is used for searching.
Searches are case insensitive.

Predefined searches

  • prefix + ctrl-f - simple file search
  • prefix + ctrl-g - jumping over git status files (best used after git status command)
  • prefix + alt-h - jumping over SHA-1/SHA-256 hashes (best used after git log command)
  • prefix + ctrl-u - url search (http, ftp and git urls)
  • prefix + ctrl-d - number search (mnemonic d, as digit)
  • prefix + alt-i - ip address search

These start "copycat mode" and jump to first match.

"Copycat mode" bindings

These are enabled when you search with copycat:

  • n - jumps to the next match
  • N - jumps to the previous match

To copy a highlighted match:

  • Enter - if you're using Tmux vi mode
  • ctrl-w or alt-w - if you're using Tmux emacs mode

Copying a highlighted match will take you "out" of copycat mode. Paste with prefix + ] (this is Tmux default paste).

Copying highlighted matches can be enhanced with tmux yank.

Installation with Tmux Plugin Manager (recommended)

Add plugin to the list of TPM plugins in .tmux.conf:

set -g @plugin 'tmux-plugins/tmux-copycat'

Hit prefix + I to fetch the plugin and source it. You should now be able to use the plugin.

Optional (but recommended) install gawk via your package manager of choice for better UTF-8 character support.

Manual Installation

Clone the repo:

$ git clone https://github.com/tmux-plugins/tmux-copycat ~/clone/path

Add this line to the bottom of .tmux.conf:

run-shell ~/clone/path/copycat.tmux

Reload TMUX environment with: $ tmux source-file ~/.tmux.conf. You should now be able to use the plugin.

Optional (but recommended) install gawk via your package manager of choice for better UTF-8 character support.

Installation for Tmux 2.3 and earlier

Due to the changes in tmux, the latest version of this plugin doesn't support tmux 2.3 and earlier. It is recommended you upgrade to tmux version 2.4 or later. If you must continue using older version, please follow these steps for installation.

Limitations

This plugin has some known limitations. Please read about it here.

Docs

  • Most of the behavior of tmux-copycat can be customized via tmux options. Check out the full options list.
  • To speed up the workflow you can define new bindings in .tmux.conf for searches you use often, more info here

Other goodies

tmux-copycat works great with:

  • tmux-yank - enables copying highlighted text to system clipboard
  • tmux-open - a plugin for quickly opening a highlighted file or a url
  • tmux-continuum - automatic restoring and continuous saving of tmux env

Test suite

This plugin has a pretty extensive integration test suite that runs on travis.

When run locally, it depends on vagrant. Run it with:

# within project top directory
$ ./run-tests

Contributions and new features

Bug fixes and contributions are welcome.

Feel free to suggest new features, via github issues.

If you have a bigger idea you'd like to work on, please get in touch, also via github issues.

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-logging

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

tmux-pain-control

standard pane key-bindings for tmux
Shell
755
star
9

tmux-open

Tmux key bindings for quick opening of a highlighted file or url
Shell
631
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