diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1022564..ec6ee78 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ Please proceed with a Pull Request only after you're assigned. It'd be sad if yo - adding better icons to [YAML files](lib/yaml/) - adding more flag options to the ruby gem. -3. (Optional) To test whether `colorls` executable is working properly, do +3. (Optional) To test whether `colorls` executable is working properly, do ```sh rake install ``` @@ -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. + +7. (Required for new flags) Add flags to `tab_complete.sh` file. diff --git a/README.md b/README.md index f2036ed..b7f9b75 100644 --- a/README.md +++ b/README.md @@ -75,9 +75,14 @@ A Ruby script that colorizes the `ls` output with color and icons. Here are the 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 diff --git a/tab_complete.sh b/tab_complete.sh new file mode 100644 index 0000000..e0a32c5 --- /dev/null +++ b/tab_complete.sh @@ -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'