From 208bfe329f29a6d08c324ed8ebe099fbdd431af8 Mon Sep 17 00:00:00 2001 From: Harry Green Date: Sat, 6 Aug 2022 21:47:09 +1200 Subject: [PATCH] Add install script --- README.md | 52 +++------------------------------------------------- install.sh | 11 +++++++++++ 2 files changed, 14 insertions(+), 49 deletions(-) create mode 100755 install.sh diff --git a/README.md b/README.md index 7b2efb1d..d999ab51 100644 --- a/README.md +++ b/README.md @@ -20,58 +20,12 @@ version is **4.3.11**. 02. Clone the repository: ```console - git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" + git clone --recursive https://github.com/HJGreen/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" ``` -
- Optional: Installing in $XDG_CONFIG_HOME +03. Run the install script `./install.sh` - Optionally, if you already have `$XDG_CONFIG_HOME` configured (usually as - _`$HOME/.config`_ by default) and intend to install Prezto under - _`$XDG_CONFIG_HOME/zsh`_ instead, you can clone the repository there and - configure `$ZDOTDIR` separately if not already configured. - - - Clone the repository: - - ```console - git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-${XDG_CONFIG_HOME:-$HOME/.config}/zsh}/.zprezto" - ``` - - - Configure `$XDG_CONFIG_HOME` and `$ZDOTDIR` in _`$HOME/.zshenv`_: - - ```sh - export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:=$HOME/.config}" - export ZDOTDIR="${ZDOTDIR:=$XDG_CONFIG_HOME/zsh}" - source "$ZDOTDIR/.zshenv" - ``` - -
- -03. Create a new Zsh configuration by copying/linking the Zsh configuration - files provided: - - ```console - setopt EXTENDED_GLOB - for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do - ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" - done - ``` - - **Note:** If you already have any of the given configuration files, `ln` in - the above operation will cause an error. In simple cases, you can load - Prezto by adding the line `source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"` to - the bottom of your _`${ZDOTDIR:-$HOME}/.zshrc`_ and keep the rest of your - Zsh configuration intact. For more complicated setups, we recommend that you - back up your original configs and replace them with the provided Prezto - [_`runcoms`_][10]. - -04. Set Zsh as your default shell: - - ```console - chsh -s /bin/zsh - ``` - -05. Open a new Zsh terminal window or tab. +04. Open a new Zsh terminal window or tab. ### [Fig](https://fig.io) diff --git a/install.sh b/install.sh new file mode 100755 index 00000000..d44d8190 --- /dev/null +++ b/install.sh @@ -0,0 +1,11 @@ +#!/bin/zsh + +cd $ZPREZTODIR +git clone --recurse-submodules https://github.com/belak/prezto-contrib contrib + +setopt EXTENDED_GLOB +for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do + ln -sf "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" +done + +chsh -s /bin/zsh