Skip to content
Myr

faq: rewrite the section on shell completions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Andrew Gallant · committed by Andrew Gallant · parent 6d7550d · Browse files · 1 file+31 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+31 added−11 removed

  • other:+31 added−11 removed

1 file+31 added−11 removed

modified:FAQ.md+31 added-11 removed
90 unmodified lines
91<h3 name="complete">92Does ripgrep have support for shell auto-completion?93</h3>9495Yes! Shell completions can be found in the96[same directory as the man page](#manpage)97after building ripgrep. Zsh completions are maintained separately and committed98to the repository in `complete/_rg`.95Yes! If you installed ripgrep through a package manager on a Unix system, then96the shell completion files included in the release archive should have been97installed for you automatically. If not, you can generate completes using98ripgrep's command line interface.99100Shell completions are also included in all101[ripgrep binary releases](https://github.com/BurntSushi/ripgrep/releases).100For **bash**:101103For **bash**, move `rg.bash` to104`$XDG_CONFIG_HOME/bash_completion` or `/etc/bash_completion.d/`.102```103$ dir="$XDG_CONFIG_HOME/bash_completion"104$ mkdir -p "$dir"105$ rg --generate complete-bash > "$dir/rg.bash"106```107106For **fish**, move `rg.fish` to `$HOME/.config/fish/completions/`.108For **fish**:109108For **zsh**, move `_rg` to one of your `$fpath` directories.110```111$ dir="$XDG_CONFIG_HOME/fish/completions"112$ mkdir -p "$dir"113$ rg --generate complete-fish > "$dir/rg.fish"114```115116For **zsh**:117118```119$ dir="$HOME/.zsh-complete"120$ mkdir -p "$dir"121$ rg --generate complete-zsh > "$dir/_rg"122```123124For **PowerShell**, create the completions:125126```127$ rg --generate complete-powershell > _rg.ps1128```129110For **PowerShell**, add `. _rg.ps1` to your PowerShell130And then add `. _rg.ps1` to your PowerShell131[profile](https://technet.microsoft.com/en-us/library/bb613488(v=vs.85).aspx)132(note the leading period). If the `_rg.ps1` file is not on your `PATH`, do133`. /path/to/_rg.ps1` instead.134
916 unmodified lines