prezto README

The project's README from github.com/sorin-ionescu/prezto. As one markdown file: README.md.

Prezto — Instantly Awesome Zsh

Prezto is the configuration framework for Zsh; it enriches the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes.

Installation

Manual

Prezto will work with any recent release of Zsh, but the minimum required version is 4.3.11.

  1. Launch Zsh:

    zsh
    
  2. Clone the repository:

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

    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:

      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:

      export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:=$HOME/.config}"
      [[ -d $XDG_CONFIG_HOME/zsh ]] && export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
      source "$ZDOTDIR/.zshenv"
      
  3. Create a new Zsh configuration by copying/linking the Zsh configuration files provided:

    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.

  4. Set Zsh as your default shell:

    chsh -s /bin/zsh
    
  5. Open a new Zsh terminal window or tab.

Troubleshooting

If you are not able to find certain commands after switching to Prezto, modify the PATH variable in ${ZDOTDIR:-$HOME}/.zprofile then open a new Zsh terminal window or tab.

Updating

Run zprezto-update to automatically check if there is an update to Prezto. If there are no file conflicts, Prezto and its submodules will be automatically updated. If there are conflicts you will be instructed to go into the $ZPREZTODIR directory and resolve them yourself.

To pull the latest changes and update submodules manually:

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

Usage

Prezto has many features disabled by default. Read the source code and the accompanying README files to learn about what is available.

Modules

  1. Browse modules to see what is available.
  2. Load the modules you need in ${ZDOTDIR:-$HOME}/.zpreztorc and then open a new Zsh terminal window or tab.

Themes

  1. For a list of themes, type prompt -l.

  2. To preview a theme, type prompt -p name.

  3. Load the theme you like in ${ZDOTDIR:-$HOME}/.zpreztorc and then open a new Zsh terminal window or tab.

    sorin theme Note that the git module may be required for special symbols to appear, such as those on the right of the above image. Add 'git' to the pmodule list (under zstyle ':prezto:load' pmodule \ in your ${ZDOTDIR:-$HOME}/.zpreztorc) to enable this module.

External Modules

  1. By default modules will be loaded from /modules and /contrib.

  2. Additional module directories can be added to the :prezto:load:pmodule-dirs setting in ${ZDOTDIR:-$HOME}/.zpreztorc.

    Note that module names need to be unique or they will cause an error when loading.

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

Customization

The project is managed via Git. We highly recommend that you fork this project so that you can commit your changes and push them to your fork on GitHub to preserve them. If you do not know how to use Git, follow this tutorial and bookmark this reference.

Resources

The Zsh Reference Card and the zsh-lovers man page are indispensable.

License

This project is licensed under the MIT License.

prezto (sorin-ionescu/prezto)

Searching Database…

14.6K ·GitHub
这是什么?Prezto 是 Unix shell Zsh 的一个配置框架。开箱即用,它为命令行带来合理的默认设置、别名、函数、自动补全和提示符主题。
那它是一个我要运行的程序,还是一套由 Zsh 加载的配置文件?不是程序——它是一套 Zsh 配置文件(runcoms)外加模块,Zsh 启动时会加载它们。你把它克隆到自己的主目录并链接其中的配置;不会有任何东西在后台运行。
我怎么把它跑起来?启动 Zsh,克隆仓库,把提供的 runcom 文件复制或链接为你的 Zsh 配置,把 Zsh 设为默认 shell,然后新开一个 Zsh 终端窗口或标签页。
我的系统需要先装什么才能用?任何较新的 Zsh 都可以,但最低要求版本是 4.3.11。还需要 Git,因为 Prezto 是通过 Git 管理的,更新时会拉取它的子模块。
我已经有自己的 .zshrc 了——换用 Prezto 会把它覆盖掉吗?如果这些配置文件已经存在,安装步骤会报错。最简单的做法:在 .zshrc 末尾加一行,引用 .zprezto/init.zsh;或者先备份原有文件,再用提供的 runcoms 替换它们。
换成 Prezto 之后有些命令找不到了,我该怎么办?这是一个已知的怪毛病:修改 .zprofile 里的 PATH 变量,然后新开一个 Zsh 终端窗口或标签页。
作者为什么建议把仓库 fork 一份?Prezto 是通过 Git 管理的,README 建议你 fork 一份,这样就可以提交自己的改动,再推送到你在 GitHub 上的 fork,把改动保存下来。
想更深入地学 Zsh 本身,我应该去哪里?README 称 Zsh Reference Card 和 zsh-lovers man 手册页是不可或缺的参考资料。
Size
2.3 MB
Stars
14.6K
Updated
CommitApr 24
Age
15y
Commits · 90 Days