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: support fzf init <shell> initialization #3505

Closed
5 of 10 tasks
akdevservices opened this issue Nov 7, 2023 · 2 comments
Closed
5 of 10 tasks

Feature request: support fzf init <shell> initialization #3505

akdevservices opened this issue Nov 7, 2023 · 2 comments

Comments

@akdevservices
Copy link
Contributor

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Feature request

Support fzf init <shell> initialization (like in starship, zoxide, navi etc) to facilitate fzf integration with other tools (file managers, utilities etc) because this style of initialization doesn't require knowledge about key-bindings and completion file paths (which can vary in different packages), fzf will generate apropriate files by itself. Such an approach also cleans up shell rc files. Instead of:

source /usr/share/fzf/completion.bash
source /usr/share/fzf/key-bindings.bash

only one line of code is required:

eval "$(fzf init bash)"

For backward compatibility reasons, the feature implementation can just output existing key-bindings and completion files to stdout. completion and keybindings parameters can be supported to get completion.<shell> or key-bindings.<shell> implementations separately:

eval "$(fzf init bash completion)"
eval "$(fzf init bash keybindings)"
@akdevservices akdevservices changed the title Feature request: support fzf init <shell> initialization Feature request: support for fzf init <shell> initialization Nov 7, 2023
@akdevservices akdevservices changed the title Feature request: support for fzf init <shell> initialization Feature request: support fzf init <shell> initialization Nov 7, 2023
@mcepl
Copy link

mcepl commented Apr 24, 2024

Hasn’t this been actually accomplished in https://github.com/junegunn/fzf/tree/0.48.0 with fzf --bash command?

And related question: what is the purpose of these files in shell/ directory at all? I am a package maintainer of fzf at OpenSUSE, and I got now into a discussion with the people on ble.sh discussions about improper location of these scripts in OpenSUSE. Shouldn’t I just get rid of those sub-packages completely and tell users just to eval appropriate output of fzf subcommands?

@akinomyoga
Copy link
Contributor

akinomyoga commented Apr 24, 2024

Let me leave a comment for cross reference. I've partially answered to the questions in akinomyoga/ble.sh#441 (reply in thread).

Hasn’t this been actually accomplished in https://github.com/junegunn/fzf/tree/0.48.0 with fzf --bash command?

Yes, I guess this issue can be closed now.

And related question: what is the purpose of these files in shell/ directory at all?

For the finer control mentioned in README, cf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants