Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Have keybindings to chose where to put selected entry #8

Open
saccarosium opened this issue Sep 15, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@saccarosium
Copy link

Hi,
I've been really enjoying the plugin. Fzy is much better than fzf in terms of quality of matches. But I've been missing a lot fzf.vim feature to just press CTRL_V to put the selected item into a vertical split.

I'm aware of FzyFindSplit but, IMO, puts some mental overhead since I don't necessarily know if I want to split or not before I made the search. My mind simply doesn't work like that.

I would be happy to make the feature myself if you are cool with it.

@bfrg bfrg added the enhancement New feature or request label Sep 15, 2024
@bfrg
Copy link
Owner

bfrg commented Sep 15, 2024

I actually wanted to implement this in the past but somehow got used to just pressing the right key mappings before opening the fuzzy finder. For example, I have <Space>fe, <Space>fs, <Space>fv and <Space>ft for finding files under current directory and opening the selected file in the current window, new horizontal split, vertical split or tab page, respectively. I have similar mappings for opening buffers, help pages, tags etc. That's why I never implemented it. Nevertheless, I am open to adding this feature 😄.

Implementing it will be a little bit tricky since there's no way to configure fzy key bindings, so we're left with using tnoremap in the terminal buffer with term_sendkeys(fzybufnr, "\<Cr>").

Fzy is much better than fzf in terms of quality of matches.

That's interesting. I haven't compared their matching/scoring algorithms so far. Can you give an example where fzy works better than fzf?

I was actually considering switching back to fzf because there hasn't been any movement in the fzy repository in over 4 years. There are a few bugs and the author doesn't even bother replying to the issuer or PRs. For example, when the terminal window is vertically resized, fzy won't redraw its screen properly. For that reason, I need to check if the --show-info option has been passed to fzy and then set Vim's terminal window to the correct height before opening fzy. Otherwise fzy's input prompt is messed up. fzf works much better in this regard. Not to mention that it provides some very useful features.

@saccarosium
Copy link
Author

Can you give an example where fzy works better than fzf?

I don't really have a concrete example on top of my head. I know that, in my experience, usually fzy is far better in matching something I already know the name (witch is my most frequent situation). Fzf on the other hand is best when I'm searching for something that I don't know the name. I think this is due to fzf matching more sparsely in the string and fzy more rigidly.

I was actually considering switching back to fzf because there hasn't been any movement in the fzy repository in over 4 years. There are a few bugs and the author doesn't even bother replying to the issuer or PRs.

Yes, this is the biggest deal breaker. For this reason I was thinking on making a fork compatible with fzy. I'm just too busy right know but at some point I probably will do it.

saccarosium added a commit to saccarosium/vim-fzy that referenced this issue Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants