Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mgalgs/fuzzy_bash_completion
Fuzzy tab completion for bash.
https://github.com/mgalgs/fuzzy_bash_completion
Last synced: 3 months ago
JSON representation
Fuzzy tab completion for bash.
- Host: GitHub
- URL: https://github.com/mgalgs/fuzzy_bash_completion
- Owner: mgalgs
- Created: 2011-10-18T22:18:31.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2019-02-21T01:07:26.000Z (almost 6 years ago)
- Last Synced: 2024-10-31T14:52:06.987Z (3 months ago)
- Language: Shell
- Homepage:
- Size: 17.6 KB
- Stars: 94
- Watchers: 5
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Intro
This bash completion module performs "fuzzy" matching similar to
textmate's "Go to File" fuzzy matching, "flex matching" in emacs' ido
mode, etc.For example:
mkdir pizza
mkdir jazz
cd zz
# displays `pizza' and `jazz'
rm -r jazz
cd zz
# completes the word `pizza'## Requirements
- `bash >= 4.0` (since we need
[associative arrays](http://www.gnu.org/software/bash/manual/html_node/Arrays.html)).
- The `bash-completion` package (could have a different name on your
distro). Please follow the instructions specific to your distro for
installing and enabling `bash-completion`.## Usage
Put the following in your `~/.inputrc`:
set show-all-if-ambiguous on
Put the following in your `~/.bashrc`:
source /path/to/fuzzy_bash_completion
Now you can start enabling fuzzy completion for individual commands like
so:fuzzy_setup_for_command cd
Either interactively or by adding it to your `~/.bashrc`.
There are a few helper functions to set up fuzzy completion for known
commands in bulk. However, these helper functions only work on certain
versions of bash completion, so YMMV.fuzzy_replace_filedir_xspec
To list all commands currently using fuzzy completion, run:
fuzzy_list_replaced_specs
## Troubleshooting
### List commands that are currently fuzzy
You can list all of the fuzzy compspecs with:
fuzzy_list_replaced_specs
### Revert back to original completion specs (debugging and development)
If something doesn't seem right and you want to back out all fuzzy
completion, you can use:fuzzy_restore_all_specs
(and you should also file a bug report [on
GitHub](https://github.com/mgalgs/fuzzy_bash_completion/issues))## Known issues, Quirks, etc
* Doesn't yet play nicely with default bash completion for variable
names.* Find something else? Report it [on
GitHub](https://github.com/mgalgs/fuzzy_bash_completion/issues) and
earn a cookie!