laktak / extrakto

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

Add option for different content grabbing behavior #8

Closed ivanalejandro0 closed 7 years ago

ivanalejandro0 commented 7 years ago

Extrakto gets its data from the whole pane, and a user may want to get it only from the visible area.

This has been discussed here: https://github.com/laktak/extrakto/pull/4, https://github.com/laktak/extrakto/pull/7#issuecomment-333400761

I think that instead of adding a config option for "how many lines you want to grab" it may be easier to grasp for a user to pick different presets, like: "grab from all the contents" or "grab only from visible area".

Proposed option name: @extrakto_grab_from (or maybe @extrakto_grab_size) Options: visible, all Default: I think that all for default makes more sense, since fzf is really fast and I think that trying to grab something from the screen that just got pushed out of sight is a pretty common case.

If https://github.com/laktak/extrakto/pull/7 gets approved, we'll have horizontal and vertical window for extrakto and the "visible area" will need to be handled differently.

Grabbing from the visible area will require to capture with -S X being X the vertical lines of the extrakto pane, or 0 if we are displaying it horizontally.

maximbaz commented 7 years ago

Other than that, looks awesome to me.

laktak commented 7 years ago

Yes, that's a great way to handle this!

laktak commented 7 years ago

Thanks @ivanalejandro0 for the PR!