Git Product home page Git Product logo

tmux-fingers's Introduction

tmux-fingers

demo

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 copied to the clipboard. Less keystrokes == profit!

Here is a list of the stuff highlighted by default.

  • File paths
  • SHAs
  • numbers ( 4+ digits )
  • hex numbers
  • IP addresses
  • kubernetes resources
  • UUIDs
  • git status/diff output

Key shortcuts

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

  • a-z: copies selected match to the clipboard
  • CTRL + a-z: copies selected match to the clipboard and triggers @fingers-ctrl-action. By default it triggers :open: action, which is useful for opening links in the browser for example.
  • SHIFT + a-z: copies selected match to the clipboard and triggers @fingers-shift-action. By default it triggers :paste: action, which automatically pastes selected matches.
  • ALT + a-z: copies selected match to the clipboard and triggers @fingers-alt-action. There is no default, configurable by the user.
  • TAB: toggle multi mode. First press enters multi mode, which allows to select multiple matches. Second press will exit with the selected matches copied to the clipboard.
  • q, ESC or CTRL + c: exit [fingers] mode

Requirements

  • tmux 3.0 or newer

Installation

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. The first time you run it you'll be presented with a wizard to complete the installation.

Manual

Clone the repo:

$ git clone https://github.com/Morantron/tmux-fingers ~/.tmux/plugins/tmux-fingers

Source it in your .tmux.conf:

run-shell ~/.tmux/plugins/tmux-fingers/tmux-fingers.tmux

Reload TMUX conf by running:

$ tmux source-file ~/.tmux.conf

The first time you run it you'll be presented with a wizard to complete the installation.

Configuration

NOTE: for changes to take effect, you'll need to source again your .tmux.conf file.

@fingers-key

default: F

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

For example:

set -g @fingers-key F

@fingers-jump-key

default: J

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

In jump mode, the cursor will be placed in the position of the match after the hint is selected.

@fingers-patterns-N

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

# You can define custom patterns like this
set -g @fingers-pattern-0 'git rebase --(abort|continue)'

# Increment the number and define more patterns
set -g @fingers-pattern-1 'some other pattern'

# You can use a named capture group like this (?<match>YOUR-REGEX-HERE)
# to only highlight and copy part of the match.
set -g @fingers-pattern-2 'capture (?<match>only this)'

# Watch out for backslashes! For example the regex \d{50} matches 50 digits.
set -g @fingers-pattern-3 '\d{50}'  # No need to escape if you use single quotes
set -g @fingers-pattern-4 "\\d{50}" # If you use double quotes, you'll need to escape backslashes for special characters to work
set -g @fingers-pattern-5 \\d{50} # Escaping also needed if you don't use any quotes

Patterns use PCRE pattern syntax.

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

@fingers-main-action

default: :copy:

By default tmux-fingers will copy matches in tmux and system clipboard.

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

set -g @fingers-main-action '<your command here>'

This command will also receive the following:

  • MODIFIER: environment variable set to ctrl, alt, or shift specififying which modifier was used when selecting the match.
  • HINT: environment variable the selected letter hint itself ( ex: q, as, etc... ).
  • stdin: copied text will be piped to @fingers-copy-command.

You can also use the following special values:

  • :paste: Copy the the match and paste it automatically.
  • :copy: Uses built-in system clipboard integration to copy the match.
  • :open: Uses built-in open file integration to open the file ( opens URLs in default browser, files in OS file navigator, etc ).

@fingers-ctrl-action

default: :open:

Same as @fingers-main-action but only called when match is selected by holding ctrl

@fingers-alt-action

Same as @fingers-main-action but only called when match is selected by holding alt

@fingers-shift-action

default: :paste:

Same as @fingers-main-action but only called when match is selected by holding shift

@fingers-hint-style

default: "fg=green,bold

With this option you can define the styles for the letter hints.

You can customize the styles using the same syntax used in .tmux.conf for styling the status bar.

More info in the STYLES section of man tmux.

Supported styles are: bright, bold, dim, underscore, italics.

@fingers-highlight-style

default: "fg=yellow"

Custom styles for the highlighted match. See @fingers-hint-format for more details.

@fingers-backdrop-style

default: ""

Custom styles for all the text that is not matched. See @fingers-hint-format for more details.

@fingers-selected-hint-style

default: "fg=blue,bold"

Format for hints in selected matches in multimode.

@fingers-selected-highlight-style

default: "fg=blue"

Format for selected matches in multimode.

@fingers-hint-position

default: "left"

Control the position where the hint is rendered. Possible values are "left" and "right".

@fingers-keyboard-layout

default: "qwerty"

Hints are generated taking optimal finger movement into account. You can choose between the following:

  • qwerty: the default, use all letters
  • qwerty-left-hand: only use letters easily reachable with left hand
  • qwerty-right-hand: only use letters easily reachable with right hand
  • qwerty-homerow: only use letters in the homerow
  • qwertz
  • qwertz-left-hand
  • qwertz-right-hand
  • qwertz-homerow
  • azerty
  • azerty-left-hand
  • azerty-right-hand
  • azerty-homerow
  • colemak
  • colemak-left-hand
  • colemak-right-hand
  • colemak-homerow
  • dvorak
  • dvorak-left-hand
  • dvorak-right-hand
  • dvorak-homerow

@fingers-show-copied-notification

default: 0

Show a message using tmux display-message notifying about the copied result.

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

tmux-fingers's People

Contributors

avimitin avatar brttbndr avatar fcsonline avatar giodamelio avatar ilyagr avatar ingomeyer441 avatar jacob-keller avatar john-kurkowski avatar kidd avatar metakirby5 avatar moetayuko avatar morantron avatar ryankemper avatar sunaku avatar ysf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tmux-fingers's Issues

Better hints, custom layouts

Problem

As pointed out here, right now hints are hardcoded in hinter.awk, and they can be improved.

The main problem is that one hint cannot be a subtset of another one: if you have a hint a you cannot have as ad or as, other hints simply cannot start by a.

Hints to be used depends on the number of matches. Imagine your alphabet is asdf.

  • For 3 matches you should use: a, s, d.
  • For 5 matches you should use: s d f aa as

As you can see, none of the the hints is a subset of another one.

This problem is solved by the n-ary huffman algorithm ( more links below ).

The harcoded hints were calculated using a small throwaway node script that uses this algorithm. However, I set up a number of 100 hints, making most of the hints to be two characters long, even if they are not necessary, and making most of the one-char hints out of the home row ( of a qwerty layout :trollface: ).

Solution

Implementing n-ary-huffman in bash/awk/gawk ๐Ÿ’€

What would be improved:

  • How hints are assigned, making them longer than one char only if necessary.
  • User configurable sequence ( qwerty, vim-sneak, dvorak ).
  • Most of the hints would fall under the user's home row, or very close.

However, we should take into account:

  • Performance should not be affected. Last time I measured, the time it takes for hints to render is near 15-20ms. If the n-ary-huffman implementation is slow, its results could be precomputed cached the first time fingers is invoked for a prefixed amount of hints ( 5, 10, 25, or everthing between 1-100 ).
  • There should be no external dependencies ( or no more if you consider gawk one ). Making tree-like structures in a language like this will be certainly challenging and fun. :trollface: If hints are precomputed maybe something like ( https://github.com/kanaka/mal ) could be used and the implementation could be easier.

Huffman related links:

https://en.wikipedia.org/wiki/Huffman_coding
https://www.npmjs.com/package/n-ary-huffman - npm package used to calculate hardcoded strings
https://rosettacode.org/wiki/Huffman_coding - reference implementations in lots of languages

Does not select all of '/' delimited words.

Issue
It only lets me select 1 word delimited by '/' as opposed to the entire path/file.

Example
screen shot 2017-02-06 at 11 39 21 pm

Things I tried
Setting set-option -g default-shell /bin/bash (instead of zsh)

System info:
screenfetch
OS: 64bit Mac OS X 10.12.3 16D32

/usr/bin/env bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)
Copyright (C) 2007 Free Software Foundation, Inc.

tmux -V
tmux 2.3

Add support for zsh

Doesn't seem to work in zsh right now. Pressing prefix + I just print the script.

gitlab merge requests url copy

When pushing a new branch to a gitlab repo I have a response that goes like this

remote:
remote: To create a merge request for regression-updates, visit:
remote:   https://gitlab.melexis.com/msde-bvx/msenv/merge_requests/new?merge_request%5Bsource_branch%5D=regression-updates
remote:
To gitlab.melexis.com:msde-bvx/msenv.git
 * [new branch]        regression-updates -> regression-updates
Branch regression-updates set up to track remote branch regression-updates from origin.

So I would like to copy the url, but unfortunately the text is partially copied, oly untile the % sign.
Is there some settings I can do to take care of this issue?

Disables the colors in my theme

How it looks like by default:
image

After activating fingers:
image

Is there a way to fix this? I'd prefer if the text which isn't active for selection is just left alone

Just want to say thank you :)

Thank you so much for this plugin! It's a best plugin what I ever found for tmux. It's like EasyMotion for vim.
And it works exactly the way as I want. Just perfect!

I'm actually using tmux already for a one year, heard about many plugins for it, but this one (the best one) found just today.

Can't detect dotfiles

Good day. I'm using this plugin in order to stage files inside git repository folder. However this plugin doesn't detect dotfiles. Here is an example
image
As you can see two files were detected while .gitignore was skipped. Is it possible to configure this plugin to detect dotfiles ?
I use the latest version of this plugin.
Tmux version is 3.0a

Can fingers work with tmux-open plugin?

Hi!
Currently tmux-fingers can only copy to clipboard choosed url/path in fingers mode. That's awesome.

There is plugin https://github.com/tmux-plugins/tmux-open/. It does one thing - open within xdg-open selected file path or url.
So, to make work tmux-fingers with tmux-open I suppose we need second mode in tmux-fingers - selection mode. in additional to current copy mode.

That means what in selection mode, finges should't copy choosen match, but instead just retun it's selection to normal tmux copy mode. Where I can easy press defauld tmux-open key ("o") and selected url/file will open in browser/editor. Or even automatically call tmux-open after path/url will be choosed.

What do you think?

doesn't work with xclipboard

I have custom bindings in my tmux.conf to copy & paste from the X clipboard.

Namely the following snippet:

# For x clipboard
if-shell 'test -n "$DISPLAY" && which xclip >/dev/null' 'bind-key -t vi-copy y copy-pipe "xclip -sel clip -i"'
if-shell 'test -n "$DISPLAY" && which xclip >/dev/null' 'bind-key -t vi-copy Enter copy-pipe "xclip -sel clip -i"'
if-shell 'test -n "$DISPLAY" && which xclip >/dev/null' 'bind-key ] run "xclip -sel clip -o | tmux load-buffer - ; tmux paste-buffer"'

This makes it so that every time I copy from tmux the text goes to the X clipboard, and every time I paste the text comes from the X clipboard.

Unfortunately tmux-fingers will only copy to the tmux clipboard. It would be cool if there was an option to override the copy command to allow using tmux-fingers with the X clipboard.

Unable to set clipboard via xclip

Expected Behavior:
According to the wiki 'set -g @fingers-copy-command 'xclip -selection clipboard' will allow tmux-fingers to copy content into the xselection clipboard.

Actual Behavior:
Selection does not appear in host clipboard.

Root Cause
Clipboard is cleared due to xclip being killed.

Narrowed it down to this line:

fingers.sh:copy_result():
49  echo -n "$result" | $FINGERS_COPY_COMMAND

At that point, xclip exits immediately, leaving the clipboard ownerless. Apparently the clipboard needs a 'owner' at all times in order to persist.

Have also tried setting the command with nohup to no avail:

.tmux.conf:
    set -g @fingers-copy-command 'nohup xclip -selection clipboard'

Not sure if we can make this work through configuring @fingers-copy-command and executing within the plugin. This may be a plugin manager issue.

Interesting to note that xclip persists when called outside the plugin context. For instance:

.tmux.conf:
    bind b run-shell 'echo test | nohup xclip -selection clipboard > /dev/null'

Will set the clipboard correctly.

works partially on OSX/BSD

Seems like 0.1.0is not working at all on OSX. I need to investigate the issue and setup automated tests to catch this problems.

EDIT: 0.1.1 partially fixes the issues, I still need to find out why some commands like ifconfig yield a blank screen.

Configure which "backend" to use when searching

I recently installed this and just want to say that this a really amazing plugin! Incredible simple yet clever idea ๐Ÿ‘

Background

  • I want to add a pattern to match semantic versions (the pattern, if you are interested, looks like this: ([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-\-\.]+)?);
  • grep doesn't think this is a valid regex;
  • ripgrep however, handles the regex just fine.

Now I could debug why grep doesn't like the regex but in general I prefer to use ripgrep over grep whenever possible. Which leads me to the question:

What do you think about having the option to configure which "backend" to use:

  • either by defining which command to run (default: grep but in my case configured to rg);
  • or a list of backends where the first one available is chosen (i.e. rg ag grep, will check if rg exists, otherwise fallback to ag etc)?

If you are interested I can see if I can throw a pull request together.

SHA hash value length

Hey, thanks for the nice project.
Is there a specific reason to limit SHA hashes to 40 characters? I know that Git uses 160 bit SHA hashes but some applications use SHA-256 or even 512. In this case tmux-fingers truncates hashes to 40 characters.

Cannot use dot in pattern

set -g @fingers-pattern-0 '([0-9a-zA-Z-.]{4,})'
set -g @fingers-pattern-0 '([0-9a-zA-Z-\.]{4,})'
Both dont work

Escape sequences in the pane are interpreted

If the pane history contains things like

scripts/debug.sh:# Source this file and call `tail -f fingers.log` when you don't know WTF is
scripts/hints.sh:IFS=$(echo -en "\n\b") # wtf bash?

Sequences like \n and \b are interpreted, when they shouldn't.

This can be seen in the screencast gif in the README :trollface:

[Bug] tmux-fingers crashing because of heredoc

Problem:
When using tmux-fingers (either by Prefix+F or by ~/.tmux/plugins/tmux-fingers/scripts/tmux-fingers.sh) I can see for a quarter of a second newly created tmux pane and then it disappears and finally nothing is happening.
OS: Mint 19.1 XFCE, bash version: 4.4.19(1), tmux version: 2.6, tmux-fingers: newest develop.

Bug probably was introduced here:
a11afa8
When I change file ~/.tmux/plugins/tmux-fingers/scripts/fingers.sh like this:

-  copy_command_parameters=<<-EOS
-    printf \"$result\" |
-      IS_UPPERCASE=$is_uppercase
-      HINT=$hint
-      CURRENT_PANE_ID=$current_pane_id
-      $exec_prefix
-  EOS
+  copy_command_parameters=printf \"$result\" | IS_UPPERCASE=$is_uppercase HINT=$hint CURRENT_PANE_ID=$current_pane_id $exec_prefix

Then everything is working properly. Command line in both options says only "create pane failed: size too small" twice, without any additional info when crashing. More info is probably in that newly created pane, but it is disappearing too quickly to read

Path not working (MacOS)

The path yanking is not working properly on MacOS Sierra (tmux 2.3, zsh 5.2), instead of yanking the whole path it only yanks until the next slash.

$ echo "/var/www/html/sites/"
pvarowwwihtmlusites/

awk compilation failure with mawk

Thank you for tmux-fingers!

Using tmux 2.1-3build1 on Ubuntu 16.04, I'm getting the following error when I activate tmux-fingers:

awk: run time error: regular expression compile failed (missing operand)
((^|^\.|[[:space:]]|[[:space:]]\.|[[:space:]]\.\.|^\.\.)[[:alnum:]~_-]*/[][[:alnum:]_.#$%&+=/@-]+)|([[:digit:]][[:digit:]][[:digit:]][[:digit:]]([[:digit:]])*)|([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]|[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])|((https?://|git@|git://|ssh://|ftp://|file:///)[[:alnum:]?=%/_.:,;~@!#$&()*+-]*)|([[:digit:]][[:digit:]]?[[:digit:]]?\.[[:digit:]][[:digit:]]?[[:digit:]]?\.[[:digit:]][[:digit:]]?[[:digit:]]?\.[[:digit:]][[:digit:]]?[[:digit:]]?)
        FILENAME="-" FNR=1 NR=1

Any ideas?

My shell is zsh (5.1.1-1ubuntu2) and awk is 1.3.3-17ubuntu2.

tmux-fingers not integrating properly with tmux-yank

Hi there,

First of all, thanks for the great plugin! I just discovered it yesterday, and am finding it really useful.

I'm having an issue with the tmux-yank integration. tmux-yank works correctly on my system, but tmux-fingers doesn't seem to be making use of it. I believe the problem is related to this line in actions.sh. On my computer, tmux-yank sets up two bind-keys for yank:

$ tmux list-keys | grep tmux-yank
bind-key    -T prefix Y                run-shell -b /home/jdaly/.tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh
bind-key    -T prefix y                run-shell -b /home/jdaly/.tmux/plugins/tmux-yank/scripts/copy_line.sh

As a result, $HAS_TMUX_YANK is set to 2. The line I linked above in actions.sh checks if $HAS_TMUX_YANK is equal to 1, which is false. If I change that line to this:

if [ "$HAS_TMUX_YANK" != "0" ]; then

then I get correct integration with tmux-yank. If this is the correct fix, it would be great to have it integrated into tmux-fingers.

Thanks for your help,
John

issue when screen has output from ls with -F switch

Minor issue related to sed syntax possibly.

When the screen has output from ls used with -F switch, the / that is put at the end of the directory names somehow makes sed unhappy. The actual error appears on the screen for a split second. Had to do a printscreen and saw this for each of the "hidden" directories (names with . as the first character).

sed: 1: " ../s~ ../~ ../ invalid command code .

or another variant for directories that are not hidden.

sed: 1: " scripts/s! scripts/!ad flag in substitute command: 'r'

Only seems to be an issue with ls output.
Did a "echo foo/" and fingers.sh had no trouble selecting it (and copying it).

But at the moment this is how far I triaged it down to. I haven't looked to fixing it yet - sorry.

[Feature request] Move cursor to the position of the hints

As the title said, it would be nice have the cursor move to the the location of the hint you type.

This is because we can not predict all kind of texts we might want to copy, so this feature would be helpful and speed things up (by moving the cursor to a good starting point) whenever that happen.

Also, if you want to do this, you might want to do both copying and moving the cursor at the same time because:

  • if the text you want to copy happens to match some regex you are done.
  • if it is not, your cursor would be moved to a good starting point.

fingers is broken with non-standard default shell

I've been experimenting a little with tmux, tmux-fingers and fish (the friendly interactive shell). It seems that setting fish as my default shell in tmux ( set-option -g default-shell "/usr/bin/fish" ), running fingers doesn't seem to work. I don't get any error, just no functionality. I looked around a little, and didn't find any immediate cause. I'm using Arch linux, installed via tpm.

Any idea of what could be the cause?

Thanks!

Ensure upgrade from pre 0.6.0 works

Version 0.6.0 introduced git submodules. Ensure this works normally when upgrading through tpm, and add check in health-check script to ensure they are set properly if user manages plugin manually.

`tmux last-pane` gives error "No last pane" after tmux-fingers was used

Observed behavior

Using tmux-fingers breaks tmux last-pane (by default prefix+;). This seems to be caused by the new window it opens, so it might be related to #31.

Desired behavior

tmux last-pane should work after using tmux-fingers. The pane that was last pane before the overlay opened should be restored as last pane after it is closed again.

Gray out non-match text

I wonder if there's a way to set the color of non-match color to gray, or anything else (like vim-easymotion).

Inconsistent failure to copy

When trying to copy something, tmux-fingers will sometimes work, but sometimes fail, giving this message:

printf "2147483648" | nohup bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel wl-copy' returned 127

I'm trying to figure out what's going on here and could use some help.
I'm using tmux-fingers with tag 0.10.1 (hash 8432c1a), tmux 2.9a, swaywm, and wl-clipboard on arch.

One key insert

Hi, could you please make it possible to select just one pattern and paste it immediately with just one key press (or at least tell how to do it)?
I tried:
bind-key i run-shell '~/.tmux/plugins/tmux-fingers/tmux-fingers.tmux && tmux paste-buffer'
But that doesn't work.

Also, it'd be cool to enable several copies and one paste of them (like in vimium tab opening):

  1. press key
  2. start several selections, appending them all to the buffer separated by space
  3. final paste

Thank you.

Cannot yank into clipboard

Hi,
I am on Archlinux KDE desktop, with tmux 2.5, tpm and tmux-yank.

Unfortunately nothing is copied into clipboard.
I have also tested adding set -g @fingers-copy-command 'xclip -selection clipboard'

Any tips?
Thanks

Broken on macOS Mojave 10.14.6

System description

  • macOS: Mojave 10.14.6
  • zsh: 5.3
  • tmux: 2.9a
  • iterm2: 3.3.7

Also tested on the macOS terminal app 2.9.5

Problem

After pressing prefix + F (capital F, means shift + f):

  • All text becomes white
  • A new tmux pane is opened with fingers in the name but focus is kept on the original window
  • Nothing happens pressing any shortcuts in the docs
  • After pressing ESC, no tmux commands work at all

Copies with a "-n " prefix

Hi! My setup is:

  • osX
  • iterm2/alacritty
  • yank
  • tmux 2.6
  • gawk 4.2.1

Every time then I'd select something with fingers it goes with "-n " prefix
f.e.

2> /dev/null)
matchs as /dev/null[p]
after I press 'p' and paste selection to any editor it's looks like
-n /dev/null
with weird -n prefix and new line at the end.
it's very annoying.
I've tried to enable debug.sh but it's doesn't do anything:(
I've tried multiple terminals. Also bash/zsh shells. Nothing changed.
When I've select with plain copy-mode - everything works ok.

Ctrl + a-z fails to open a link on Ubuntu when the kbd package is installed

Describe the bug

When pressing a hint which targets a url while pressing the Ctrl modifier key, the url is not opened in the browser if the kbd package is installed; the latter installs a symlink at /bin/open which points to /bin/openvt.

To Reproduce

Install the kbd package:

$ sudo apt-get install kbd

Clone the plugin in a directory:

$ git clone https://github.com/Morantron/tmux-fingers

Initialize the submodules:

$ git submodule update --init --recursive

Write this in /tmp/tmux.conf:

run /run/user/1000/tmp/tmux-fingers/tmux-fingers.tmux

Start Tmux with this minimal config file:

$ tmux -Lx -f/tmp/tmux.conf

Run this shell command:

$ echo 'https://github.com/Morantron/tmux-fingers'

Press C-b and F to generate a hint; then press Ctrl plus the hint which targets the url.

The url is not opened, and this error message is displayed:

'printf "https://github.com/Morantron/tmux-fingers" | MODIFIER=ctrl HINT=s  xargs open' returned 123

Expected behavior

The url is opened in the web browser, and no error message is displayed.

Environment

  • plugin version: commit 0ce16f5
  • Tmux version: tmux next-3.1
  • OS: Ubuntu 16.04.6 LTS
  • Terminal: XTerm(322)

Additional context

I think the issue comes from these lines:

if [[ $(program_exists "open") = "1" ]]; then
echo "xargs open"
elif [[ $(program_exists "xdg-open") = "1" ]]; then
echo "xargs xdg-open"

Right now, I've reversed the order of the 2 if/elseif clauses:

if [[ $(program_exists "xdg-open") = "1" ]]; then
  echo "xargs xdg-open"
elif [[ $(program_exists "open") = "1" ]]; then
  echo "xargs open"

Which fixes my issue. I don't know whether it would cause an issue on other OSes.
I would naively think it's ok, because xdg-open is more specific than open, so it makes sense to test it first, but I could be wrong.

On invocation, some output message flashes on screen before hints are shown

When I do -F to invoke hints, I see some log output flash on the screen before it goes back to my regular screen with hints enabled.

Here's a screenshot:
screenshot from 2017-03-11 00-09-42

I also notice a new window gets opened in tmux, temporarily while hint-mode is active. Not sure if it has any relation.

I'm on zsh, by the way.

allow disabling default regexp

Is it possible to disable the default search parameters? I don't really need number searching, and I don't really find the path searching that useful since it gets a lot of false positives. Thus, these hints clutter the display making it harder to locate the things I want to copy.

mention user must checkout submodules

It seems that the behavior changed recently with the addition of a git submodule, and when I upgraded to tmux 2.5, it was broken until I realized to checkout the submodules. This wasn't documented.

if there are no matches don't capture user input

Sometimes you run tmux fingers on a screen that doesn't have anything that tmux-fingers recognizes a link. However, fingers still requires user input. It would be a better user experience if simply fingers gets out of the way (and maybe display a message on tmux saying no matches were found)

Extra brackets at the end in urls

First of all thanks for this awesome tmux plugin! Keep it up!

When I hint a markdown document I have a minor issue because of extra brackets at the end in urls

Result
([mimadrid](https://github.com/mimadrid))[i]

Expected
([mimadrid](https://github.com/mimadrid[i]))

The pattern is https://github.com/Morantron/tmux-fingers/blob/master/scripts/config.sh#L57 but I don't know a proper solution to this also I think that the fault is totally mine by not add spaces to both sides of the url :/

I hope to be useful

Thanks a lot again for your hard work!

Activating fingers opens a new window

Hello again,

Just updated to 0.6.0. Now when I activate the plugin, it activates fingers mode in a new tmux tab. Is there some new configuration that needs to be set somewhere to prevent this? I breezed the readme and nothing stuck out immediately.

Thanks ๐Ÿ˜„

custom highlight format

Would love a way to set a variable in tmux to change the default highlight format as

hint_format = "\033[30;1;43m%s\033[0m"
highlight_format = "\033[1;33m%s\033[0m"

is not readable with my current terminal colorscheme

Copy one occurrence

If i had several identical words on screen it has one hint, but copy all lines.

Custom key

Hi,
Can I set custom key without prefix to start fingers mode?
Thanks

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.