Closed maximbaz closed 7 years ago
That's a great idea! I'm all for reducing the keystrokes I have to type ;)
Only x is already used: bind-key -T prefix x confirm-before -p "kill-pane #P? (y/n)" kill-pane
That's true. Prefix, e/E don't seem to be used, how about these for defaults?
Can be remembered for E
xtrakto 🙂
Long term you could make these two shortcuts configurable, see here for an example.
I implemented your idea and also added extract for everything with prefix + tab
. Thanks again! I've been using it all day as it works like command completion on remote ssh sessions without having to install anything. Let me know if you find it useful.
Looking good, thanks! I'm a little surprised to find that Prefix, Tab and Prefix, e discover different results now - I'm curious why did you do it like this?
I use Prefix+Tab
like complete to insert everything from the buffer (like docker container names etc). With Prefix+e
I usually want to copy something specific like an url.
If that is unintuitive I should probably make tab
and e
behave the same way.
I wouldn't mind being able to copy everything from the buffer, the first example that comes to mind is copying a git branch name to share with someone, and today I can find the branch name with Prefix, Tab but not with Prefix, e.
But maybe that is even better, the regex that you have for Prefix, Tab is simpler, maybe that is the only regex that we need?
I've made tab
and e
the same. If it turns out subotimal we can think of alternatives later.
Thanks! I tested, everything seem to work perfectly. I'll close the issue, and I'll be using the plugin over the next days to see how I like it, and like you said, if anyone feels it is suboptimal, lets discuss in a new thread!
@maximbaz I've added options as well.
@maximbaz @ivanalejandro0 I now managed to put all the options behind a single keybinding. Please let me know if it works for you.
This is really awesome! I have one tiny comment for you, and there's a bug with Ctrl+f
toggling. When the pane has no URLs or file path, the toggling exits fzf. Better see a video, this is me pressing Ctrl+f
twice, after the second press fzf
exits. It doesn't reproduce when there is at least one URL or file path in the pane though.
Thanks for the video! Not sure why fzf
didn't return 0 in that case - I only handle the selected keys now so that should fix it.
Confirmed, the bug is fixed - I guess you can close this ticket again 😄 I didn't even know that fzf allows to handle multiple selection keys differently, really useful - great finding!
Looking forward to #8 now, one last item to make this plugin absolutely perfect 🙏
Right! ;)
I'm late to the party... this is really cool! I like the changes :smile:
Instead of having type Prefix, Shift+X, u/U/p/P, how about the following:
Typing just Prefix, Shift+X opens a fzf with all potential candidates: files, urls, paths, whatever. It is so easy to filter in fzf, that I think it is an overkill to have different modes.
We could have just two shortcuts:
No need to write one single super-complex regex, let's have multiple regexes (one for urls, one for paths, etc.) and just run them all one by one, and combine their results in fzf window.