@@ -10,7 +10,7 @@ instantly using a fuzzy match, with or without an interactive menu.
1010
1111# Fuzzy CD
1212
13- ![ Version] ( https://img.shields.io/badge/version-0.2.3 -blue.svg )
13+ ![ Version] ( https://img.shields.io/badge/version-0.2.4 -blue.svg )
1414[ ![ Build Status] ( https://github.com/DannyBen/fuzzycd/workflows/Test/badge.svg )] ( https://github.com/DannyBen/fuzzycd/actions?query=workflow%3ATest )
1515
1616## Features
@@ -28,6 +28,7 @@ instantly using a fuzzy match, with or without an interactive menu.
2828 - Minimal - cd to best match
2929 - Interactive
3030 - Interactive with ` ls ` preview
31+ - Optional fuzzy bash completions.
3132
3233## Prerequisites
3334
@@ -61,16 +62,14 @@ You are encouraged to inspect the [setup script](setup) before running.
6162
6263 ```
6364 $ cd -h
64-
65- fuzzycd 0.2.3
66-
6765 Usage:
6866 cd DIR change working directory
6967 cd SEARCH change working directory or show selection menu
7068 cd -l list history with fzf
7169 cd -e edit history file
7270 cd -s show history file
7371 cd -d [DIR] delete current or specified directory from history
72+ cd -c show completions function [usage: eval "$(cd -c)"]
7473 cd -v show version
7574 cd -h show this help
7675
@@ -84,6 +83,10 @@ You are encouraged to inspect the [setup script](setup) before running.
8483 i = interactive when needed, no preview
8584 p = interactive when needed, with ls preview
8685
86+ FUZZYCD_COMPLETIONS_COUNT
87+ Maximum number of suggestions to show in bash completions
88+ (default: 10)
89+
8790 Interactive Keyboard Bindings:
8891 Del
8992 Delete selected directory from history
@@ -119,10 +122,25 @@ matching directories when running in interactive mode, or you will
119122` cd ` to the best match when running in non-interactive mode (default).
120123
121124
125+ ## Bash completions
126+
127+ To enable fuzzy bash completions, add the following line to your ` ~/.bashrc ` :
128+
129+ ``` bash
130+ eval " $( cd -c) "
131+ ```
132+
133+ This works best when tab completion is configured for inline completions, which
134+ you can set by adding/updating the ` ~/.inputrc ` file:
135+
136+ ``` bash
137+ # ~/.inputrc
138+ TAB: menu-complete
139+ ```
140+
122141## Uninstall
123142
124- 1 . Remove the ` source /usr/local/bin/fuzzycd ` line from your startup script(s)
125- (` ~/.bashrc ` and/or ` ~/.zshrc ` ).
143+ 1 . Remove the ` source /usr/local/bin/fuzzycd ` line from your ` ~/.bashrc ` .
1261442 . Delete ` /usr/local/bin/fuzzycd ` .
1271453 . Optionally, delete the history file (` ~/.fuzzycd-history ` ).
1281464 . Retsrat your session.
0 commit comments