← Back to sorin-ionescu/prezto

How to Deploy & Use sorin-ionescu/prezto

Prezto Deployment and Usage Guide

Prerequisites

  • Zsh: Version 4.3.11 or later
  • Git: For cloning the repository and managing updates
  • Terminal access: To configure shell settings

Installation

Clone the Repository

git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"

Create Zsh Configuration Files

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 existing Zsh configuration files, you can either:

  1. Back up your original configs and replace them with Prezto's runcoms
  2. Add source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" to the bottom of your existing ~/.zshrc

Set Zsh as Default Shell

chsh -s /bin/zsh

Optional: Install in $XDG_CONFIG_HOME

If you prefer to install Prezto in $XDG_CONFIG_HOME/zsh instead of $HOME/.zprezto:

git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-${XDG_CONFIG_HOME:-$HOME/.config}/zsh}/.zprezto"

Then configure $XDG_CONFIG_HOME and $ZDOTDIR in ~/.zshenv:

export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:=$HOME/.config}"
[[ -d $XDG_CONFIG_HOME/zsh ]] && export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
source "$ZDOTDIR/.zshenv"

Configuration

Load Modules

Edit ~/.zpreztorc to enable desired modules:

zstyle ':prezto:load' pmodule \
  'environment' \
  'terminal' \
  'editor' \
  'history' \
  'directory' \
  'spectrum' \
  'utility' \
  'completion' \
  'prompt' \
  'git'

Select Prompt Theme

Edit ~/.zpreztorc to set your preferred theme:

zstyle ':prezto:module:prompt' theme 'sorin'

Available themes can be listed with:

prompt -l

Preview themes with:

prompt -p theme_name

Add External Module Directories

To add additional module directories:

zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib

Build & Run

Prezto doesn't require building. To activate changes:

  1. Open a new Zsh terminal window or tab
  2. Or run: source ~/.zshrc

Update Prezto

Run the update script:

zprezto-update

Manual update procedure:

cd $ZPREZTODIR
git pull
git submodule sync --recursive
git submodule update --init --recursive

Deployment

Prezto is a personal configuration framework and doesn't require traditional deployment. For sharing your configuration:

  1. Fork the repository on GitHub
  2. Commit your changes to your fork
  3. Push to GitHub to preserve your customizations

For team environments, you can:

  • Create a shared fork with standardized configurations
  • Use Git submodules to include Prezto in team projects
  • Document required modules and themes for consistency

Troubleshooting

Missing Commands After Installation

If certain commands are not found after switching to Prezto:

  1. Modify the PATH variable in ~/.zprofile
  2. Add necessary directories to your path
  3. Open a new Zsh terminal window or tab

Module Loading Errors

If modules fail to load:

  • Ensure module names are unique
  • Check that required dependencies are installed
  • Verify paths in ~/.zpreztorc are correct

Git Integration Issues

If Git symbols don't appear in your prompt:

  • Ensure the git module is enabled in ~/.zpreztorc
  • Verify Git is installed and accessible in your PATH
  • Check that git is properly configured

Configuration Conflicts

If you experience conflicts with existing configurations:

  • Review your ~/.zshrc for conflicting settings
  • Temporarily rename your original config to test Prezto
  • Gradually migrate settings from your old config to Prezto's runcoms

Performance Issues

If Zsh startup is slow:

  • Disable unused modules in ~/.zpreztorc
  • Check for slow-running commands in your configuration
  • Consider using zprof to profile startup time

Resources

For additional help and reference: