2021-05-04 01:59:31 +00:00
|
|
|
# Configuration Files
|
2012-05-22 16:49:45 +00:00
|
|
|
|
|
|
|
Zsh has several system-wide and user-local configuration files.
|
|
|
|
|
2021-07-05 02:07:48 +00:00
|
|
|
Additionally, Prezto has one user-local configuration file.
|
2012-09-03 20:38:18 +00:00
|
|
|
|
2012-05-22 16:49:45 +00:00
|
|
|
System-wide configuration files are installation-dependent but are installed
|
2021-07-05 02:07:48 +00:00
|
|
|
in _`/etc`_ by default.
|
2012-05-22 16:49:45 +00:00
|
|
|
|
|
|
|
User-local configuration files have the same name as their global counterparts
|
|
|
|
but are prefixed with a dot (hidden). Zsh looks for these files in the path
|
2018-10-12 08:55:55 +00:00
|
|
|
stored in the `$ZDOTDIR` environment variable. However, if said variable is
|
2012-05-22 16:49:45 +00:00
|
|
|
not defined, Zsh will use the user's home directory.
|
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## File Descriptions
|
2012-05-22 16:49:45 +00:00
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
The [configuration files][1] are read in the following order:
|
|
|
|
|
2021-07-05 02:07:48 +00:00
|
|
|
1. _`/etc/zshenv`_
|
|
|
|
2. _`${ZDOTDIR:-$HOME}/.zshenv`_
|
|
|
|
3. _`/etc/zprofile`_
|
|
|
|
4. _`${ZDOTDIR:-$HOME}/.zprofile`_
|
|
|
|
5. _`/etc/zshrc`_
|
|
|
|
6. _`${ZDOTDIR:-$HOME}/.zshrc`_
|
|
|
|
7. _`${ZDOTDIR:-$HOME}/.zpreztorc`_
|
|
|
|
8. _`/etc/zlogin`_
|
|
|
|
9. _`${ZDOTDIR:-$HOME}/.zlogin`_
|
|
|
|
10. _`${ZDOTDIR:-$HOME}/.zlogout`_
|
|
|
|
11. _`/etc/zlogout`_
|
2012-05-22 16:49:45 +00:00
|
|
|
|
|
|
|
### zshenv
|
|
|
|
|
|
|
|
This file is sourced by all instances of Zsh, and thus, it should be kept as
|
2012-06-12 19:13:21 +00:00
|
|
|
small as possible and should only define environment variables.
|
2012-05-22 16:49:45 +00:00
|
|
|
|
|
|
|
### zprofile
|
|
|
|
|
2021-07-05 02:07:48 +00:00
|
|
|
This file is similar to _zlogin_, but it is sourced before _zshrc_. It was added
|
|
|
|
for [KornShell][2] fans. See the description of _zlogin_ below for what it may
|
2012-05-22 16:49:45 +00:00
|
|
|
contain.
|
|
|
|
|
2021-07-05 02:07:48 +00:00
|
|
|
_zprofile_ and _zlogin_ are not meant to be used together but can be done so.
|
2012-05-22 16:49:45 +00:00
|
|
|
|
|
|
|
### zshrc
|
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
This file is sourced by interactive shells. It should define aliases, functions,
|
|
|
|
shell options, and key bindings.
|
2012-05-22 16:49:45 +00:00
|
|
|
|
2013-11-29 22:34:34 +00:00
|
|
|
### zpreztorc
|
2012-09-03 20:38:18 +00:00
|
|
|
|
|
|
|
This file configures Prezto.
|
2012-05-22 16:49:45 +00:00
|
|
|
|
|
|
|
### zlogin
|
|
|
|
|
2021-07-05 02:07:48 +00:00
|
|
|
This file is sourced by login shells after _zshrc_. Thus, it should contain
|
2012-05-22 16:49:45 +00:00
|
|
|
commands that need to execute at login. It is usually used for messages such as
|
2021-07-05 02:07:48 +00:00
|
|
|
[_`fortune`_][3], [_`msgs`_][4], or for the creation of files.
|
2012-05-22 16:49:45 +00:00
|
|
|
|
|
|
|
This is not the file to define aliases, functions, shell options, and key
|
|
|
|
bindings. It should not change the shell environment.
|
|
|
|
|
|
|
|
### zlogout
|
|
|
|
|
|
|
|
This file is sourced by login shells during logout. It should be used for
|
2021-05-04 01:59:31 +00:00
|
|
|
displaying messages and for deletion of files.
|
2012-05-22 16:49:45 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Authors
|
2012-05-22 16:49:45 +00:00
|
|
|
|
2021-07-05 02:07:48 +00:00
|
|
|
_The authors of these files should be contacted via the [issue tracker][5]._
|
2012-05-22 16:49:45 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
2012-05-22 16:49:45 +00:00
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
[1]: http://zsh.sourceforge.net/Intro/intro_3.html#SEC3
|
|
|
|
[2]: https://www.kornshell.com
|
|
|
|
[3]: https://en.wikipedia.org/wiki/Fortune_(Unix)
|
|
|
|
[4]: https://www.manpagez.com/man/1/msgs
|
|
|
|
[5]: https://github.com/sorin-ionescu/prezto/issues
|