From 8f7b9be356c005435f5612904f38ed5d95cc2aa0 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Fri, 6 Jan 2017 22:52:57 -0500 Subject: [PATCH] Add docs for shell completion files. Add small howtos for installing shell completion files to the README and the man page. They are still incomplete. We're missing Zsh and PowerShell. Fixes #262 --- README.md | 10 ++++++++++ doc/rg.1 | 11 +++++++++++ doc/rg.1.md | 10 ++++++++++ 3 files changed, 31 insertions(+) diff --git a/README.md b/README.md index a7e0c01e..f3eb36c1 100644 --- a/README.md +++ b/README.md @@ -302,6 +302,16 @@ extensions. The syntax supported is [documented as part of Rust's regex library](https://doc.rust-lang.org/regex/regex/index.html#syntax). +### Shell completions + +Shell completion files are included in the release tarball for Bash, Fish, Zsh +and PowerShell. + +For **bash**, move `rg.bash-completion` to `$XDG_CONFIG_HOME/bash_completion` +or `/etc/bash_completion.d/`. + +For **fish**, move `rg.fish` to `$HOME/.config/fish/completions`. + ### Building `ripgrep` is written in Rust, so you'll need to grab a diff --git a/doc/rg.1 b/doc/rg.1 index 6ce5bd65..7b87ea40 100644 --- a/doc/rg.1 +++ b/doc/rg.1 @@ -409,3 +409,14 @@ ripgrep. Note that this must be passed to every invocation of rg. .RS .RE +.SH SHELL COMPLETION +.PP +Shell completion files are included in the release tarball for Bash, +Fish, Zsh and PowerShell. +.PP +For \f[B]bash\f[], move \f[C]rg.bash\-completion\f[] to +\f[C]$XDG_CONFIG_HOME/bash_completion\f[] or +\f[C]/etc/bash_completion.d/\f[]. +.PP +For \f[B]fish\f[], move \f[C]rg.fish\f[] to +\f[C]$HOME/.config/fish/completions\f[]. diff --git a/doc/rg.1.md b/doc/rg.1.md index 748e5aa5..0bd08504 100644 --- a/doc/rg.1.md +++ b/doc/rg.1.md @@ -273,3 +273,13 @@ Project home page: https://github.com/BurntSushi/ripgrep : Clear the file type globs previously defined for TYPE. This only clears the default type definitions that are found inside of ripgrep. Note that this must be passed to every invocation of rg. + +# SHELL COMPLETION + +Shell completion files are included in the release tarball for Bash, Fish, Zsh +and PowerShell. + +For **bash**, move `rg.bash-completion` to `$XDG_CONFIG_HOME/bash_completion` +or `/etc/bash_completion.d/`. + +For **fish**, move `rg.fish` to `$HOME/.config/fish/completions`.