From 94426ba18b8ecaacaa3ae308b7578c9832401431 Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Tue, 15 Oct 2024 00:36:54 +0800 Subject: [PATCH] docs/Shell-Completion: update Zsh completions docs for Linux --- docs/Shell-Completion.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Shell-Completion.md b/docs/Shell-Completion.md index d8a145e310..2f0ee2bd5d 100644 --- a/docs/Shell-Completion.md +++ b/docs/Shell-Completion.md @@ -34,14 +34,14 @@ If you are using Homebrew's `bash` as your shell (i.e. `bash` >= v4) you should ## Configuring Completions in `zsh` -To make Homebrew's completions available in `zsh`, the Homebrew-managed `zsh/site-functions` path needs to be inserted into `FPATH` before initialising `zsh`'s completion facility. This is done by `brew shellenv`, so if you followed the post-Homebrew installation steps and have `eval "$(brew shellenv)"` in your `~/.zprofile`, all you need is add the following to your `~/.zshrc` if it's not already there: +To make Homebrew's completions available in `zsh`, the Homebrew-managed `zsh/site-functions` path needs to be inserted into `FPATH` before initialising `zsh`'s completion facility. This is done by `brew shellenv`, so if you followed the post-Homebrew installation steps, `eval "$(brew shellenv)"` should be in your `~/.zprofile` (on macOS) or `~/.zshrc` (on Linux). All you need is add the following to your `~/.zshrc` if it's not already there, and, if you're on Linux, make sure it's placed after `eval "$(brew shellenv)"`: ```sh autoload -Uz compinit compinit ``` -Note that if you are using Oh My Zsh, it will call `compinit` for you when you source `oh-my-zsh.sh`. In this case, you should be all set without any additional configuration. +Note that if you are using Oh My Zsh, it will call `compinit` for you when you source `oh-my-zsh.sh`. In this case, make sure `eval "$(brew shellenv)"` is called before sourcing `oh-my-zsh.sh` if you're on Linux, and you should be all set without any additional configuration. You may also need to forcibly rebuild `zcompdump`: