Git Product home page Git Product logo

tmux-copycat's Introduction

Tmux copycat

Build Status

This plugin enables:

  • regex searches
  • 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.

Note: new version 2.0 uses extended regexes! Regex character escaping with backslashes \ isn't required anymore.

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

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

You might want to follow @brunosutic on twitter if you want to hear about new tmux plugins or feature updates.

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

By default tests run in 2 vagrant VMs: ubuntu and centos.

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

tmux-copycat's People

Contributors

toupeira avatar soli avatar bruno- avatar metcalfc avatar grota avatar inkarkat avatar jrolfs avatar s3rvac avatar qstrahl avatar vellvisher avatar f440 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.