Update README.md with ZIM_CONFIG_FILE instructions
Also add git-info and duration-info modules to the basic templates for a better user experience.
This commit is contained in:
parent
4200e6cdb3
commit
4fcc85b2db
1 changed files with 40 additions and 14 deletions
54
README.md
54
README.md
|
@ -47,12 +47,14 @@ Installing Zim is easy. You can choose either the automatic or manual method bel
|
||||||
This will install a predefined set of modules and a theme for you.
|
This will install a predefined set of modules and a theme for you.
|
||||||
|
|
||||||
* With `curl`:
|
* With `curl`:
|
||||||
|
```zsh
|
||||||
curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
|
curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
|
||||||
|
```
|
||||||
|
|
||||||
* With `wget`:
|
* With `wget`:
|
||||||
|
```zsh
|
||||||
wget -nv -O - https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
|
wget -nv -O - https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
|
||||||
|
```
|
||||||
|
|
||||||
Restart your terminal and you're done. Enjoy your Zsh IMproved! Take some time
|
Restart your terminal and you're done. Enjoy your Zsh IMproved! Take some time
|
||||||
to tweak your [`~/.zshrc`](#set-up-zshrc) file, and to also check the available
|
to tweak your [`~/.zshrc`](#set-up-zshrc) file, and to also check the available
|
||||||
|
@ -82,7 +84,16 @@ Add the lines below to your `~/.zshrc` file, in the following order:
|
||||||
This is optional, and only required if you don't have `git` installed (yes,
|
This is optional, and only required if you don't have `git` installed (yes,
|
||||||
Zim works even without `git`!)
|
Zim works even without `git`!)
|
||||||
|
|
||||||
2. To set where the directory used by Zim will be located:
|
2. To set where the `zimfw` plugin manager configuration file will be located:
|
||||||
|
```zsh
|
||||||
|
ZIM_CONFIG_FILE=~/.config/zsh/zimrc
|
||||||
|
```
|
||||||
|
This is optional. The value of `ZIM_CONFIG_FILE` can be any path your user
|
||||||
|
has at least read access to. By default, the file must be at `~/.zimrc`, if
|
||||||
|
the `ZDOTDIR` environment variable is not defined. Otherwise, it must be at
|
||||||
|
`${ZDOTDIR}/.zimrc`.
|
||||||
|
|
||||||
|
3. To set where the directory used by Zim will be located:
|
||||||
```zsh
|
```zsh
|
||||||
ZIM_HOME=~/.zim
|
ZIM_HOME=~/.zim
|
||||||
```
|
```
|
||||||
|
@ -91,7 +102,7 @@ Add the lines below to your `~/.zshrc` file, in the following order:
|
||||||
`~/.cache/zim` if you also include the step below, that automatically
|
`~/.cache/zim` if you also include the step below, that automatically
|
||||||
downloads the `zimfw` plugin manager.
|
downloads the `zimfw` plugin manager.
|
||||||
|
|
||||||
3. To automatically download the `zimfw` plugin manager if missing:
|
4. To automatically download the `zimfw` plugin manager if missing:
|
||||||
```zsh
|
```zsh
|
||||||
# Download zimfw plugin manager if missing.
|
# Download zimfw plugin manager if missing.
|
||||||
if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then
|
if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then
|
||||||
|
@ -110,11 +121,11 @@ Add the lines below to your `~/.zshrc` file, in the following order:
|
||||||
This is optional. If you choose to not include this step, you should manually
|
This is optional. If you choose to not include this step, you should manually
|
||||||
download the `zimfw.zsh` script once and keep it at `${ZIM_HOME}`.
|
download the `zimfw.zsh` script once and keep it at `${ZIM_HOME}`.
|
||||||
|
|
||||||
4. To automatically install missing modules and update the static initialization
|
5. To automatically install missing modules and update the static initialization
|
||||||
script if missing or outdated:
|
script if missing or outdated:
|
||||||
```zsh
|
```zsh
|
||||||
# Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated.
|
# Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated.
|
||||||
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
|
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} ]]; then
|
||||||
source ${ZIM_HOME}/zimfw.zsh init -q
|
source ${ZIM_HOME}/zimfw.zsh init -q
|
||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
|
@ -122,7 +133,7 @@ Add the lines below to your `~/.zshrc` file, in the following order:
|
||||||
it, you must remember to manually run `zimfw install` every time after you
|
it, you must remember to manually run `zimfw install` every time after you
|
||||||
update your [`~/.zimrc`](#create-zimrc) file.
|
update your [`~/.zimrc`](#create-zimrc) file.
|
||||||
|
|
||||||
5. To source the static script, that will initialize your modules:
|
6. To source the static script, that will initialize your modules:
|
||||||
```zsh
|
```zsh
|
||||||
# Initialize modules.
|
# Initialize modules.
|
||||||
source ${ZIM_HOME}/init.zsh
|
source ${ZIM_HOME}/init.zsh
|
||||||
|
@ -130,18 +141,31 @@ Add the lines below to your `~/.zshrc` file, in the following order:
|
||||||
|
|
||||||
#### Create `~/.zimrc`
|
#### Create `~/.zimrc`
|
||||||
|
|
||||||
You must create your `.zimrc` file at `~/.zimrc`, if the `ZDOTDIR` environment
|
This file configures the `zimfw` plugin manager. It's referred to as `~/.zimrc`
|
||||||
variable is not defined. Otherwise, it must be at `${ZDOTDIR}/.zimrc`. It's
|
in the documentation for the sake of simplicity, but the actual location of the
|
||||||
referred to as `~/.zimrc` in the documentation for the sake of simplicity.
|
file is defined following these rules:
|
||||||
|
|
||||||
You can start with just:
|
1. You can define the full path and name of the file with a `ZIM_CONFIG_FILE`
|
||||||
|
environment variable. For example:
|
||||||
|
```zsh
|
||||||
|
ZIM_CONFIG_FILE=~/.config/zsh/zimrc
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Or, if you defined a `ZDOTDIR` environment variable, then the file must be at
|
||||||
|
`${ZDOTDIR}/.zimrc`
|
||||||
|
|
||||||
|
3. Otherwise, it must be at at `~/.zimrc`, which is it's default location.
|
||||||
|
|
||||||
|
As for the contents of the file, you can start with just:
|
||||||
```zsh
|
```zsh
|
||||||
zmodule zsh-users/zsh-syntax-highlighting
|
zmodule zsh-users/zsh-syntax-highlighting
|
||||||
zmodule zsh-users/zsh-autosuggestions
|
zmodule zsh-users/zsh-autosuggestions
|
||||||
```
|
```
|
||||||
|
|
||||||
If you also want one of our prompt [themes]:
|
If you also want one of our prompt [themes]:
|
||||||
```
|
```zsh
|
||||||
|
zmodule git-info
|
||||||
|
zmodule duration-info
|
||||||
zmodule asciiship
|
zmodule asciiship
|
||||||
zmodule zsh-users/zsh-syntax-highlighting
|
zmodule zsh-users/zsh-syntax-highlighting
|
||||||
zmodule zsh-users/zsh-autosuggestions
|
zmodule zsh-users/zsh-autosuggestions
|
||||||
|
@ -149,6 +173,8 @@ zmodule zsh-users/zsh-autosuggestions
|
||||||
|
|
||||||
If you want to use our [completion] module too, instead of using `compinit` directly:
|
If you want to use our [completion] module too, instead of using `compinit` directly:
|
||||||
```zsh
|
```zsh
|
||||||
|
zmodule git-info
|
||||||
|
zmodule duration-info
|
||||||
zmodule asciiship
|
zmodule asciiship
|
||||||
zmodule zsh-users/zsh-completions --fpath src
|
zmodule zsh-users/zsh-completions --fpath src
|
||||||
zmodule completion
|
zmodule completion
|
||||||
|
|
Loading…
Reference in a new issue