tmux-copycat


Ⅰ. 插件描述

A plugin that enhances tmux search

Ⅱ. 基本信息

创建日期:  2014-06-04
使用用户:  2
Github星:  772
插件作者:  tmux-plugins

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'tmux-plugins/tmux-copycat'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'tmux-plugins/tmux-copycat'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'tmux-plugins/tmux-copycat'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/tmux-plugins/tmux-copycat

Ⅳ. 文档说明

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

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.<br/>
Searches are case insensitive.<br/>

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

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

添加新评论