Adds support for tab completion (#135)

* added support for tab completion

* minor changes in README

* updated CONTRIBUTING.md and other minor changes

* removed typo
This commit is contained in:
Rohit Ner 2017-10-22 23:40:36 +05:30 committed by Athitya Kumar
parent b2fa5f18d7
commit af734a6bbb
3 changed files with 14 additions and 3 deletions

View file

@ -47,3 +47,5 @@ Please proceed with a Pull Request only after you're assigned. It'd be sad if yo
``` ```
6. (Required for new flags) Add command to `.travis.yml` file. 6. (Required for new flags) Add command to `.travis.yml` file.
7. (Required for new flags) Add flags to `tab_complete.sh` file.

View file

@ -75,9 +75,14 @@ A Ruby script that colorizes the `ls` output with color and icons. Here are the
rehash rehash
``` ```
4. Start using `colorls` :tada: 4. Enable tab completion for flags by entering following line to your shell configuration file (`~/.bashrc` or `~/.zshrc`) :
```bash
source $(dirname $(gem which colorls))/tab_complete.sh
```
5. Have a look at [Recommended configurations](#recommended-configurations). 5. Start using `colorls` :tada:
6. Have a look at [Recommended configurations](#recommended-configurations).
# Recommended configurations # Recommended configurations

4
tab_complete.sh Normal file
View file

@ -0,0 +1,4 @@
_colorls_options='-1 -a -A -d -f -l -r -t -h
--all --almost-all --dirs --files --long --report --sort-dirs --group-directories-first
--sort-files --git-status --tree --help --sd --sf --gs'
complete -W "${_colorls_options}" 'colorls'