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

Ctrl-T binding for bash and zsh should optionally use the current command-line as the root directory for the recursive search #3480

Open
6 of 10 tasks
mcepl opened this issue Oct 15, 2023 · 3 comments

Comments

@mcepl
Copy link

mcepl commented Oct 15, 2023

  • 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

Problem / Steps to reproduce

This is basically reverse of #2562

When I am in some random directory (e.g., build/) and I write on the command line:

$ ls ~/Books<Ctrl-T>

I would expect that fzf completion mechanism starts searching through ~/Books/ directory. It does in fish, but not in bash (and according to https://github.com/junegunn/fzf#fish-shell not in zsh as well), where it still searches through pwd.

Would it be possible to optionally make this completion work in bash in the same manner as described here (and how it works with fish), please?

For me currently it is the only reason why I cannot switch back to bash.

@junegunn
Copy link
Owner

Like I said earlier, I don't know how to implement it on bash. If you know how to do it and if you think it doesn't significantly increase the complexity of the code, please open a pull request. Otherwise, ls ~/Books**<tab> is the way.

@junegunn
Copy link
Owner

Or you can,

bind -m emacs-standard '"\C-t": "**\C-i"'

(Granted, fuzzy completion on bash is limited in that it doesn't work for all commands)

@mcepl
Copy link
Author

mcepl commented Jan 11, 2024

Like I said earlier, I don't know how to implement it on bash. If you know how to do it and if you think it doesn't significantly increase the complexity of the code, please open a pull request. Otherwise, ls ~/Books**<tab> is the way.

That just doesn’t display the fzf dialogue at all (and yes, I source /usr/share/bash-completion/completions/fzf-key-bindings from openSUSE fzf package fzf-bash-completion-0.45.0-1.1.noarch), but cd ~/build ; ls ~/Knihy/fanfiction/**<Ctrl-I> just gives me the standard bash message Display all 3096 possibilities? (y or n).

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

2 participants