A lightning fast version of tmux-fingers written in Rust, copy/pasting tmux like vimium/vimperator
A lightning fast version of tmux-fingers written in Rust, copy/pasting tmux like vimium/vimperator
A lightning fast version of tmux-fingers written in Rust for copy pasting with vimium/vimperator like hints.
Press ( prefix + Space ) to highlight in you current tmux visible pane all text that match specific patterns. Then press the highlighted letter hint to yank the text in your tmux buffer.
These are the list of matched patterns that will be highlighted by default. If
you want to highlight a pattern that is not in this list you can add one or
more with --regexp parameter.
You can add this line to your list of TPM plugins in .tmux.conf:
set -g @plugin 'fcsonline/tmux-thumbs'
run-shell ~/.tmux/plugins/tmux-thumbs/tmux-thumbs.tmuxTo be able to install the plugin just hit prefix + I. You should now be able to use the plugin!
tmux-thumbs is written in Rust. You will need rustc version 1.35.0 or higher. The
recommended way to install Rust is from the official download page.
Clone the repo:
git clone https://github.com/fcsonline/tmux-thumbs ~/.tmux/plugins/tmux-thumbsCompile it with cargo:
cd ~/.tmux/plugins/tmux-thumbs
cargo build --releaseSource it in your .tmux.conf:
run-shell ~/.tmux/plugins/tmux-thumbs/tmux-thumbs.tmuxReload TMUX conf by running:
tmux source-file ~/.tmux.confIf you want to customize how is shown your tmux-thumbs hints those all available parameters to set your perfect profile.
NOTE: for changes to take effect, you'll need to source again your .tmux.conf file.
default: space
Choose which key is used to enter in thumbs mode.
For example:
set -g @thumbs-key FIf you want to customize the way how tmux-thumbs is triggered, you can always
bind whatever key to thumbs-pick command. For example:
bind-key \; thumbs-pickdefault: qwerty
Choose which set of characters is used to build hints. Review all available alphabets
For example:
set -g @thumbs-alphabet dvorak-homerowdefault: disabled
Choose in which direction you want to assign hints. Useful to get shorter hints closer to the cursor.
For example:
set -g @thumbs-reverse enableddefault: disabled
Choose if you want to assign the same hint for the same matched strings.
For example:
set -g @thumbs-unique enableddefault: left
Choose where do you want to show the hint in the matched string. Options (left, right, off_left, off_right).
For example:
set -g @thumbs-position rightAdd extra patterns to match. This parameter can have multiple instances.
For example:
set -g @thumbs-regexp-1 '[\w-\.]+@([\w-]+\.)+[\w-]{2,4}' # Match emails
set -g @thumbs-regexp-2 '[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:' # Match MAC addresses
set -g @thumbs-regexp-3 'Vlan\d+' # match Vlan interface on network devices
set -g @thumbs-regexp-4 "Vlan\\d+" # alternative method of defining regexp
set -g @thumbs-regexp-5 Vlan\\d+ # alternative method of defining regexpdefault: 'tmux set-buffer -- {} && tmux display-message \"Copied {}\"'
Choose which command execute when you press a hint. tmux-thumbs will replace {} with the picked hint.
For example:
set -g @thumbs-command 'echo -n {} | pbcopy'default: 'tmux set-buffer -- {} && tmux paste-buffer && tmux display-message \"Copied {}\"'
Choose which command execute when you press a upcase hint. tmux-thumbs will replace {} with the picked hint.
For example:
set -g @thumbs-upcase-command 'echo -n {} | pbcopy'default: 'tmux set-buffer -- {} && tmux paste-buffer && tmux send-keys ' ' && tmux display-message \"Copied multiple items!\"'
Choose which command execute when you select multiple items. tmux-thumbs will replace {} with the picked hint for each one.
For example:
set -g @thumbs-multi-command 'echo -n {}'default: black
Sets the background color for matches
For example:
set -g @thumbs-bg-color bluedefault: green
Sets the foreground color for matches
For example:
set -g @thumbs-fg-color greendefault: black
Sets the background color for hints
For example:
set -g @thumbs-hint-bg-color bluedefault: yellow
Sets the foreground color for hints
For example:
set -g @thumbs-hint-fg-color greendefault: blue
Sets the foreground color for selection
For example:
set -g @thumbs-select-fg-color reddefault: black
Sets the background color for selection
For example:
set -g @thumbs-select-bg-color reddefault: yellow
Sets the foreground color for multi selected item
For example:
set -g @thumbs-multi-fg-color greendefault: black
Sets the background color for multi selected item
For example:
set -g @thumbs-multi-bg-color reddefault: 0
Displays hint character in square brackets for extra visibility.
For example:
set -g @thumbs-contrast 1default: 0
If this is set to 1, tmux-thumbs will print a OSC52 copy escape sequence when you select a match, in addition to running the pick command. This sequence, in terminals that support it (e.g. iTerm), allows the content to be copied into the system clipboard in addition to the tmux copy buffer.
For example:
set -g @thumbs-osc52 1This is the list of predefined colors:
There is also support for using hex colors in the form of #RRGGBB.
This is the list of available alphabets:
numeric: 1234567890abcd: abcdqwerty: asdfqwerzxcvjklmiuopghtybnqwerty-homerow: asdfjklghqwerty-left-hand: asdfqwerzcxvqwerty-right-hand: jkluiopmyhnazerty: qsdfazerwxcvjklmuiopghtybnazerty-homerow: qsdfjkmghazerty-left-hand: qsdfazerwxcvazerty-right-hand: jklmuiophynqwertz: asdfqweryxcvjkluiopmghtzbnqwertz-homerow: asdfghjklqwertz-left-hand: asdfqweryxcvqwertz-right-hand: jkluiopmhzndvorak: aoeuqjkxpyhtnsgcrlmwvzfidbdvorak-homerow: aoeuhtnsiddvorak-left-hand: aoeupqjkyixdvorak-right-hand: htnsgcrlmwvzcolemak: arstqwfpzxcvneioluymdhgjbkcolemak-homerow: arstneiodhcolemak-left-hand: arstqwfpzxcvcolemak-right-hand: neioluymjhkIf you want to enable the capability to choose multiple matches, you have to press Space. Then, choose the matches with highlighted hints or Enter (moving with cursors) and then Space again to output all of them.
If you run standalone thumbs with multi selection mode (-m) you will be able to choose multiple hints pressing the desired letter and Space to finalize the selection.
This is the known list of versions of tmux compatible with tmux-thumbs:
| Version | Compatible |
|---|---|
| 3.0a | ✅ |
| 2.9a | ✅ |
| 2.8 | ❓ |
| 2.7 | ❓ |
| 2.6 | ✅ |
| 2.5 | ❓ |
| 2.4 | ❓ |
| 2.3 | ❓ |
| 1.8 | ❓ |
| 1.7 | ❓ |
If you can check hat tmux-thumbs is or is not compatible with some specific version of tmux, let me know.
thumbsThis project started as a tmux plugin but after reviewing it with some
friends we decided to explore all the possibilities of decoupling thumbs from
tmux. You can install it with a simple command:
cargo install thumbsAnd those are all available options:
…If you want to enjoy terminal hints, you can do things like this without tmux:
> alias pick='thumbs -u -r | xsel --clipboard -i'
> git log | pickOr multi selection:
> git log | thumbs -m
1df9fa69c8831ac042c6466af81e65402ee2a007
4897dc4ecbd2ac90b17de95e00e9e75bb540e37fStandalone thumbs has some similarities to FZF.
As I said, this project is based in tmux-fingers. Morantron did an extraordinary job, building all necessary pieces in Bash to achieve the text picker behaviour. He only deserves my gratitude for all the time I have been using tmux-fingers.
During a Fosdem conf, we had the idea to rewrite it to another language. He had these thoughts many times ago but it was hard to start from scratch. So, we decided to start playing with Node.js and react-blessed, but we detected some unacceptable latency when the program booted. We didn't investigate much about this latency.
During those days another alternative appeared, called tmux-picker, implemented in python and reusing many parts from tmux-fingers. It was nice, because it was fast and added original terminal color support.
I was curious to know if this was possible to be written in Rust, and soon I realized that was something doable. The ability to implement tests for all critic parts of the application give you a great confidence about it. On the other hand, Rust has an awesome community that lets you achieve this kind of project in a short period of time.
tmux-thumbs from tmuxthumbs can run standalonetmux-thumbs must work lighting fast. If you are facing a slow performance capturing the screen hints try to configure Tmux with these settings:
set -g visual-activity off
set -g visual-bell off
set -g visual-silence onYou can read a bit more about this issue here: https://github.com/fcsonline/tmux-thumbs/issues/88
Every time I use tmux-thumbs, dead panes are created. Just review if you have
this setting on:
set -g remain-on-exit onYou can read a bit more about this issue here: https://g
No open issues yet, or sync has not completed.