3. Create a new Zsh configuration by copying the Zsh configuration files
provided:
```
```sh
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
@ -37,7 +41,9 @@ version is 4.3.17.
@@ -37,7 +41,9 @@ version is 4.3.17.
4. Set Zsh as your default shell:
`chsh -s /bin/zsh`
```console
chsh -s /bin/zsh
```
5. Open a new Zsh terminal window or tab.
@ -57,9 +63,11 @@ into the `$ZPREZTODIR` directory and resolve them yourself.
@@ -57,9 +63,11 @@ into the `$ZPREZTODIR` directory and resolve them yourself.
To pull the latest changes and update submodules manually:
@ -15,14 +15,18 @@ The format of the [git-log][8] output is configurable via the following style,
@@ -15,14 +15,18 @@ The format of the [git-log][8] output is configurable via the following style,
where context is *brief*, *oneline*, and *medium*, which will be passed to the
`--pretty=format:` switch.
```sh
zstyle ':prezto:module:git:log:context' format ''
```
### Status
Retrieving the status of a repository with submodules can take a long time.
Submodules may be ignored when they are *dirty*, *untracked*, *all*, or *none*.
Aliases are enabled by default. You can disable them with:
```sh
zstyle ':prezto:module:git:alias' skip 'yes'
```
### Git
@ -335,7 +341,9 @@ To display information about the current repository in a prompt, define the
@@ -335,7 +341,9 @@ To display information about the current repository in a prompt, define the
following styles in the `prompt_name_setup` function, where the syntax for
setting a style is as follows.
```sh
zstyle ':prezto:module:git:info:context:subcontext' format 'string'
```
### Main Contexts
@ -362,7 +370,9 @@ setting a style is as follows.
@@ -362,7 +370,9 @@ setting a style is as follows.
The following contexts must be enabled with the following zstyle:
```sh
zstyle ':prezto:module:git:info' verbose 'yes'
```
### Verbose Contexts
@ -395,14 +405,18 @@ The following contexts must be enabled with the following zstyle:
@@ -395,14 +405,18 @@ The following contexts must be enabled with the following zstyle:
First, format the repository state attributes. For example, to format the branch
and remote names, define the following styles.
```sh
zstyle ':prezto:module:git:info:branch' format 'branch:%b'
zstyle ':prezto:module:git:info:remote' format 'remote:%R'
```
Second, format how the above attributes are displayed in prompts.
```sh
zstyle ':prezto:module:git:info:keys' format \
'prompt' ' git(%b)' \
'rprompt' '[%R]'
```
Last, add `$git_info[prompt]` to `$PROMPT` and `$git_info[rprompt]` to
`$RPROMPT` respectively and call `git-info` in the `prompt_name_preexec` hook
@ -9,7 +9,9 @@ To enable OpenSSH Agent protocol emulation, and make `gpg-agent` a drop-in
@@ -9,7 +9,9 @@ To enable OpenSSH Agent protocol emulation, and make `gpg-agent` a drop-in
replacement for `ssh-agent`, add the following line to
*~/.gnupg/gpg-agent.conf*:
```conf
enable-ssh-support
```
When OpenSSH Agent protocol emulation is enabled, this module will load the SSH
@ -14,15 +14,19 @@ Mac OS X in *~/Library/Perl/5.12* by altering the environment.
@@ -14,15 +14,19 @@ Mac OS X in *~/Library/Perl/5.12* by altering the environment.
For Perl versions older than 5.14, install *local::lib*.
To select a prompt theme, add the following to *zpreztorc*, and replace **name**
with the name of the theme you wish to load. Setting it to **random** will load
a random theme.
```sh
zstyle ':prezto:module:prompt' theme 'name'
```
### Prompt Display Length
To change working directory prompt display length from 'short', set the
following to 'long' (without '~' expansion) or 'full' (with '~' expansion)
in *zpreztorc*.
```sh
zstyle ':prezto:module:prompt' pwd-length 'short'
```
Theming
-------
@ -26,7 +40,7 @@ There are three theme functions, a setup function, a help function, and
@@ -26,7 +40,7 @@ There are three theme functions, a setup function, a help function, and
a preview function. The setup function **must** always be defined. The help
function and the preview functions are optional.
#### prompt_name_setup
#### `prompt_name_setup`
This function is called by the `prompt` function to install the theme. This
function may define other functions as necessary to maintain the prompt,
@ -36,18 +50,21 @@ including a function that displays help or a function used to preview it.
@@ -36,18 +50,21 @@ including a function that displays help or a function used to preview it.
The most basic example of this function can be seen below.
```sh
function prompt_name_setup {
PROMPT='%m%# '
RPROMPT=''
}
```
#### prompt_name_help
#### `prompt_name_help`
If the `prompt_name_setup` function is customizable via parameters, a help
function **should** be defined. The user will access it via `prompt -h name`.
The most basic example of this function can be seen below.
```sh
function prompt_name_help {
cat <<EOH
This prompt is color-scheme-able. You can invoke it thus:
@ -57,14 +74,16 @@ The most basic example of this function can be seen below.
@@ -57,14 +74,16 @@ The most basic example of this function can be seen below.
where the color is for the left-hand prompt.
EOH
}
```
#### prompt_name_preview
#### `prompt_name_preview`
If the `prompt_name_setup` function is customizable via parameters, a preview
function **should** be defined. The user will access it via `prompt -p name`.
The most basic example of this function can be seen below.
```sh
function prompt_name_preview {
if (( $# > 0 )); then
prompt_preview_theme theme "$@"
@ -74,13 +93,14 @@ The most basic example of this function can be seen below.
@@ -74,13 +93,14 @@ The most basic example of this function can be seen below.
prompt_preview_theme theme yellow magenta black
fi
}
```
### Hook Functions
There are many Zsh [hook][2] functions, but mostly the *precmd* hook will be
used.
#### prompt_name_precmd
#### `prompt_name_precmd`
This hook is called before the prompt is displayed and is useful for getting
information to display in a prompt.
@ -93,11 +113,13 @@ a function before you calling it.
@@ -93,11 +113,13 @@ a function before you calling it.
The most basic example of this function can be seen below.
@ -52,14 +52,18 @@ The variable `$PROJECT_HOME` tells virtualenvwrapper where to place project
@@ -52,14 +52,18 @@ The variable `$PROJECT_HOME` tells virtualenvwrapper where to place project
working directories. It must be set and the directory created before `mkproject`
is used. Replace *Developer* with your projects directory.
```sh
export PROJECT_HOME="$HOME/Developer"
```
The variable `$VIRTUALENVWRAPPER_VIRTUALENV_ARGS` tells virtualenvwrapper what
arguments to pass to `virtualenv`. For example, set the value to
*--system-site-packages* to ensure that all new environments have access to the
@ -68,7 +72,9 @@ directory where the root of the project matches a virtualenv name.
@@ -68,7 +72,9 @@ directory where the root of the project matches a virtualenv name.
@ -13,12 +13,16 @@ Starts a GNU Screen session automatically when Zsh is launched.
@@ -13,12 +13,16 @@ Starts a GNU Screen session automatically when Zsh is launched.
To enable this feature when launching Zsh in a local terminal, add the
following line to *zpreztorc*:
```sh
zstyle ':prezto:module:screen:auto-start' local 'yes'
```
To enable this feature when launching Zsh in a SSH connection, add the
@ -45,10 +49,12 @@ Each syntax highlighter defines styles used to highlight tokens.
@@ -45,10 +49,12 @@ Each syntax highlighter defines styles used to highlight tokens.
To highlight, for example, builtins, commands, and functions in blue instead of
@ -13,33 +13,43 @@ Starts a tmux session automatically when Zsh is launched.
@@ -13,33 +13,43 @@ Starts a tmux session automatically when Zsh is launched.
To enable this feature when launching Zsh in a local terminal, add the
following line to *zpreztorc*:
```sh
zstyle ':prezto:module:tmux:auto-start' local 'yes'
```
To enable this feature when launching Zsh in a SSH connection, add the
Read [iTerm2 and tmux Integration][7] for more information.
@ -57,7 +67,9 @@ connected** to be displayed, which can be fixed by installing
@@ -57,7 +67,9 @@ connected** to be displayed, which can be fixed by installing
[reattach-to-user-namespace][3], available in [Homebrew][4], and adding the
@ -14,11 +14,15 @@ Each file should contain a line with the MAC address of the target device and
@@ -14,11 +14,15 @@ Each file should contain a line with the MAC address of the target device and
the network broadcast address. For instance, there might be a file
*~/.wakeonlan/leto* with the following contents:
```conf
00:11:22:33:44:55:66 192.168.0.255
```
To wake that device, use the following command:
wake leto
```sh
$ wake leto
```
For more information on the configuration file format, read the