laktak / extrakto

extrakto for tmux - quickly select, copy/insert/complete text without a mouse
MIT License
878 stars 45 forks source link

Piping to xclip is missing #1

Closed maximbaz closed 7 years ago

maximbaz commented 7 years ago

This sample (for tmux 2.4+) defines a extract-mode that you enter with X and then use p to extract paths or u for urls (piping to xclip)

I think the piping to xclip part was forgotten in the example, and I actually cannot come up a proper syntax to do it myself... Could you help out?

I want to pipe to xclip -selection clipboard

laktak commented 7 years ago

Not sure why but xclip only works when run in the background. Please try it with the update.

maximbaz commented 7 years ago

It works, awesome!


I'll just dump my feedback and thoughts in here, let me know if you want me to organize them somehow, like in different issues:

  1. The piece send -X cancel \; causes troubles for me, every time I press a hotkey, all I see is a message from tmux Not in a mode. If I remove this piece from every binding, everything begins to work perfectly. Not sure what it is supposed to do 🙂 I'm on a tmux built from master branch maybe a month ago, ArchLinux.

  2. Definitely wrap it in a tmux plugin, this thing is awesome! Filtering with fzf is faster than copycat's way of jumping one by one between matches. Ideally I'd not have to download any binaries or put extra bindings in my .tmux.conf, except of only one line set -g @plugin 'laktak/extrakto' 🙂

  3. Regexes could use some improvements, but this we can definitely take separately.

image

  1. The script doesn't handle wrapped text very well, like see in the example below the top url suggestion ends with veee, although this is not the end of the url.

image

laktak commented 7 years ago
  1. that were some leftovers because I use it from vi mode, sorry
  2. have you made any tmux plugins or can you point me to a short sample?
  3. and 4. - yes PRs are welcome ;) I tried to find some existing regexes for extracting paths and urls but came up suprisingly short.
maximbaz commented 7 years ago
  1. No personal experience, but I would suggest to look into tmux-plugins/tmux-example-plugin or at some of the existing plugins under tmux-plugins account.

  2. and 4. Definitely :) But regardless, do release the plugin, the current regexes work acceptably well, if something would feel particularly annoying, I'll submit a PR :)

For future reference, here are the regexes from tmux-copycat itself:

https://github.com/tmux-plugins/tmux-copycat/blob/57ce42387aa70b7b20346a27f582f5ca0239bff2/copycat.tmux#L17-L22

maximbaz commented 7 years ago

I'll close the issue since xclip is fixed now 🙂

laktak commented 7 years ago

@maximbaz it should now work as a plugin.

maximbaz commented 7 years ago

And it works indeed, awesome stuff!