Start a zsh session with a different .zshrc
.
zsh zvanilla.zsh [-h] [-k] [-s <shell command>] [-t <tmpdir>] <zshrc>"
Without a file, it will start a zsh session with no initial configurations.
The environment variable ZVANILLA_DIR
can be used to reference the temporary
directory that is used as the ZDOTDIR
.
This script was originally written to test out zplug in a vanilla environment.
% cat ~/zshrc
export ZPLUG_HOME=$ZVANILLA_DIR
export ZPLUG_ROOT=$ZVANILLA_DIR
unset ZPLUG_LOADFILE
# export ZPLUG_LOADFILE=~/.zplug.zsh
source ~/.zplug/init.zsh
zplug 'zsh-users/zsh-syntax-highlighting'
zplug check || zplug install
zplug load
% zvanilla ~/zshrc
Installing... zsh-users/zsh-syntax-highlighting
Installed! zsh-users/zsh-syntax-highlighting (1.52s)
==> Installation finished successfully!
zplug: total wall-time 1.553036 sec.
% exit
%
Some more examples.
% cat my_zshrc.zsh
echo 'Hello, World!'
PROMPT='>>> '
% ./zvanilla.zsh my_zshrc.zsh
Hello, World!
>>> exit
%
Or, you can use curl to download and directly execute the script without saving it.
% cat my_zshrc.zsh
echo 'Hello, World!'
PROMPT='>>> '
# First -s is an option for zsh to pass in arguments
% zsh -c "$( curl -L https://git.io/zvanilla )" -s -s /usr/local/bin/zsh -t . my_zshrc.zsh
Hello, World!
>>> exit
%
MIT
Naoki Mizuno