Zsh

From Gentoo Wiki
Jump to: navigation, search

Zsh (Z shell) is an interactive login shell that can also be used as a powerful scripting language interpreter. It is similar to bash and the Korn shell, but offers extensive configurability, powerful commandline completion, file globbing, and spelling correction.

Installation

Install app-shells/zsh:

USE flag (what is that?) Default Recommended Description
caps No Use Linux capabilities library to control privilege
debug No No Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml
doc No Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
examples No Yes Install examples, usually source code
gdbm No Add support for sys-libs/gdbm (GNU database libraries)
maildir No Add support for maildir (~/.maildir) style mail spools
pcre No Add support for Perl Compatible Regular Expressions
static No  !!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically
unicode No Yes Add support for Unicode
root #emerge --ask zsh

Also install app-shells/zsh-completion, which is optional, but enables auto-completion for arguments of commands, which is one of the strengths of Zsh:

root #emerge --ask zsh-completion
Note
To enable 'zsh-completion' globally for every program, add it to your USE flags in /etc/portage/make.conf

Configuration

Upon running Zsh for the first time as a new user, you will be greeted by a basic configuration dialog. You can skip this by pressing q to configure Zsh manually.

To make Zsh your default shell, you can run:

user $chsh -s /bin/zsh

Zsh's main configuration file is ~/.zshrc and you can reload this configuration in a running shell with:

user $source ~/.zshrc

See also

External resources