From 4f4cd91bbce99068c513bb68f530e9b22df5ffb9 Mon Sep 17 00:00:00 2001 From: Aidin Gharibnavaz Date: Fri, 21 Sep 2018 17:06:48 +1200 Subject: [PATCH] Adds `Auto completion' section. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index dacb0ce..837d68c 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,19 @@ Get the latest binary on the [Releases](https://github.com/MarianoGappa/sql/rele go get -u github.com/MarianoGappa/sql ``` +### Auto completion + +Optionaly, you can install auto complete scripts for your shell too. It will complete the name of databases. + +For bash, copy or link `sql-bash-autocomplete` file to `/etc/bash_completion.d` directory. + +For zsh, copy or link `sql-zsh-autocomplete` file to somewhere in your `$fpath`. (If you use oh-my-zsh framework, copy/link it to `~/.oh-my-zsh/completions`.) Note that file should be renamed to `_sql`. You may also need to run the following commands in order to force ZSH to rebuild its auto completion cache. + +``` +$ rm ~/.zcompdump +$ compinit +``` + ## Configuration Create a `.databases.json` dotfile in your home folder or in any [XDG-compliant](https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) directory. [This](.databases.json.example) is an example file.