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

Add fuzzy bash completions #17

Merged
merged 5 commits into from
Apr 22, 2024
Merged

Add fuzzy bash completions #17

merged 5 commits into from
Apr 22, 2024

Conversation

DannyBen
Copy link
Owner

@DannyBen DannyBen commented Apr 21, 2024

This PR adds fuzzy bash completions to the cd command.

  1. The new cd -c command outputs a short completions function
  2. To install it, simply call eval "$(cd -c)" in the current session, or in ~/.bashrc
  3. Type cd some-fuzzy-search<TAB> to see the result.
  4. The suggestions are sorted by the same fzf priority.

This is particularly useful when tab completions are configured to instantly complete the line. To do so, add the below lines to ~/.inputrc (create the file if needed).

# ~/.inputrc
# Change tab behavior and add shift tab for old behavior
TAB: menu-complete
"\e[Z": complete

@DannyBen DannyBen merged commit 21a41d2 into master Apr 22, 2024
5 checks passed
@DannyBen DannyBen deleted the add/completions-function branch April 22, 2024 04:36
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

Successfully merging this pull request may close these issues.

1 participant