Go to file
Jorge Morante 87254fd5c3 update README.md 2016-10-17 23:43:52 +02:00
.git-hooks /usr/bin/env bash all the things 2016-07-15 08:31:45 +02:00
scripts remove log traces 2016-10-17 23:16:10 +02:00
test force terminal resolution when running tests 2016-10-17 23:42:39 +02:00
.gitignore gitignore all logs 2016-07-14 22:45:14 +02:00
CHANGELOG.md updated CHANGELOG.md 2016-08-24 08:10:40 +02:00
LICENSE README.md + LICENSE 2016-05-01 19:50:41 +02:00
README.md update README.md 2016-10-17 23:43:52 +02:00
Vagrantfile initial setup of automated tests 2016-07-14 22:48:01 +02:00
circle.yml initial setup of automated tests 2016-07-14 22:48:01 +02:00
tmux-fingers.tmux user configurable patterns 2016-04-30 00:58:58 +02:00

README.md

tmux-fingers

CircleCI

tmux-fingers: copy pasting with vimium/vimperator like hints.

yay

Usage

Press ( prefix + F ) to enter [fingers] mode, it will highlight relevant stuff in the current pane along with letter hints. By pressing those letters, the highlighted match will be yanked. Less keystrokes == profit!

Relevant stuff:

  • File paths
  • git SHAs
  • numbers ( 4+ digits )
  • urls
  • ip addresses

It also works on copy mode, but requires tmux 2.2 or newer to properly take the scroll position into account.

Additionally, you can install tmux-yank for system clipboard integration.

Key shortcuts

While the in [fingers] mode, you can use the following shortcuts:

  • a-z: yank a highlighted hint.
  • <space>: toggle compact hints ( see @fingers-compact-hints ).
  • <Ctrl-C>: exit [fingers] mode
  • <esc>: exit help or [fingers] mode
  • ?: show help.

Requirements

  • bash 4+
  • tmux 2.1+ ( 2.2 recommended )
  • gawk ( optional but recommended )

Installation

Using Tmux Plugin Manager

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

set -g @plugin 'Morantron/tmux-fingers'

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

Manual

Clone the repo:

➜ git clone https://github.com/Morantron/tmux-fingers ~/clone/path

Source it in your .tmux.conf:

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

Reload TMUX conf by running:

➜ tmux source-file ~/.tmux.conf

Configuration

You can change the key that invokes tmux-fingers:

@fingers-key

default: F

Customize how to enter copy mode. Always preceded by prefix: prefix + @fingers-key

set -g @fingers-key F

@fingers-patterns-N

You can also add additional patterns if you want more stuff to be highlighted:

set -g @fingers-pattern-0 'git rebase --(abort|continue)'
set -g @fingers-pattern-1 'yolo'
.
.
.
set -g @fingers-pattern-50 'whatever'

Patterns are case insensitive, and grep's extended syntax ( ERE ) should be used. man grep for more info.

If the introduced regexp contains an error, an error will be shown when invoking the plugin.

It's recommended to install gawk for better support of custom patterns: some things like interval expressions do not work in built-in awk in OSX/BSD systems.

@fingers-copy-command

By default tmux-fingers will just yank matches using tmux clipboard ( or tmux-yank if present ).

If you still want to set your own custom command you can do so like this:

set -g @fingers-copy-command 'xclip -selection clipboard'

@fingers-compact-hints

default: 1

By default tmux-fingers will show hints a compact format. For example:

/path/to/foo/bar/lol

with @fingers-compact-hints set to 1:

awath/to/foo/bar/lol

with @fingers-compact-hints set to 0:

/path/to/foo/bar/lol [aw]

( pressing aw would yank /path/to/foo/bar/lol )

While in [fingers] mode you can press <space> to toggle compact mode on/off.

Compact mode is preferred because it preserves the length of lines and doesn't cause line wraps, making it easier to follow.

However for small hints this can be troublesome: a path as small as /a/b would have half of its original content concealed. If that's the case you can quickly toggle off compact mode by pressing <space>.

Acknowledgements and inspiration

This plugin is heavily inspired by tmux-copycat ( tmux-fingers predefined search are copycatted :trollface: from tmux-copycat ).

Kudos to bruno- for paving the way to tmux plugins! 👏 👏

License

MIT