Options
Command Prompt
Completion
Change Directory
Auto cd
Named Directories
Directory Stack
Aliases
Command History
Key Bindings
Shortcuts
Startup and Termination
Update List of Commands
References
zsh options are case insensitive and underscores are ignored. An option name may be inverted by preceding it with ‘no’, so setopt No_Beep is equivalent to unsetopt beep. [Manual]
autoload -Uz promptinitpromptinit-U: suppress alias expansion when the function is loaded-z: mark the function to be autoloaded using the zsh style$ prompt adam1adam1 prompt scheme$ prompt -l$ whence -f promptinitTo load completion:
autoload -Uz compinit
compinit
zstyle ':completion:*' menu select=3zstyle ':completion:*:correct:*' insert-unambiguous truesetopt auto_cdcd to that directoryFrequently used directories can be abbreviated.
hash -d ff=$HOME/soft/firefox/ff for directory $HOME/soft/firefox/$ cd ~ff$ hash -Ldsetopt auto_pushdcd dir-name results in adding dir-name onto the directory stacksetopt pushd_ignore_dupsdirs -vpushd dir-namedir-name to the stackpopd +2Frequently used commands can be abbreviated.
alias ll='ls -al --color --group-directories-first'll$ aliassetopt share_historysetopt hist_ignore_all_dupssetopt hist_ignore_spacesetopt hist_reduce_blanksHISTSIZE=2000SAVEHIST=2000HISTFILE=$HOME/.zsh_historybindkey command manipulates keymaps and key bindings.
bindkey "^[[1;5D" backward-wordCtrl+←: move to the beginning of the previous wordbindkey "^[[1;5C" forward-wordCtrl+→: move to the beginning of the next wordread shows what key is typed.
User's Guide: All the startup files
Order of initialization files:
/etc/zsh/zshenv
$HOME/.zshenv
/etc/zsh/zprofile
$HOME/.zprofile
/etc/zsh/zshrc
$HOME/.zshrc
/etc/zsh/zlogin
$HOME/.zlogin
Termination:
$HOME/.zlogout
/etc/zsh/zlogout
zsh does not automatically recognize new commands after installation of new packages.
$ rehash