Starting with macOS 10.15 Catalina, zsh will be the default macOS shell. Zsh is highly configurable but configuration can be tricky. Get up and running with some essential options and plugins, and an informative prompt theme.
% which zsh
the output should be /bin/zsh
% cd && vim .zshrc
add following content into .zshrc
PROMPT='%n:%~ %(!.#.$) '
Reload the current shell by % source .zshrc
or new a terminal
$ brew install zsh-completions
Add following content into .zshrc
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
autoload -Uz compinit
compinit
fi
Reload the current shell by % source .zshrc
or new a terminal
- QA
If there shows the warning message
zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?
try the command : $ compaudit | xargs chmod g-w
with a new line output There are insecure directories: