Skip to main content

♻️ Migration

OMZ Basics

Raw Syntax with URL:

zi snippet <URL>

OMZ Shorthand Syntax:

https://github.com/ohmyzsh/ohmyzsh/raw/master/

zi snippet OMZ::<PATH>

OMZL:

http://github.com/ohmyzsh/ohmyzsh/raw/master/lib

zi snippet OMZL::<PATH>

OMZP:

http://github.com/ohmyzsh/ohmyzsh/raw/master/plugins

zi snippet OMZP::<PATH>

OMZT:

http://github.com/ohmyzsh/ohmyzsh/raw/master/themes

zi snippet OMZT::<PATH>

OMZ Library

Importing the clipboard and termsupport from the OMZ library sample:

Raw Syntax:

zi snippet https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/clipboard.zshzi snippet https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/termsupport.zsh

OMZ Shorthand Syntax:

zi snippet OMZ::lib/clipboard.zshzi snippet OMZ::lib/termsupport.zsh

OMZL Shorthand Syntax:

zi snippet OMZL::clipboard.zshzi snippet OMZL::termsupport.zsh

OMZ Plugins

- plugins=(-  git-  dotenv-  rake-  rbenv-  ruby-)+ zi snippet OMZP::git+ zi snippet OMZP::dotenv+ zi snippet OMZP::rake+ zi snippet OMZP::rbenv+ zi snippet OMZP::ruby
tip

Bundle multiple commands to a single file:

zi snippet <some/path/or/url/bundled-snippets.zsh

Plugins

- plugins=(-  git-  dotenv-  rake-  rbenv-  ruby-)+ zi snippet OMZP::git+ zi snippet OMZP::dotenv+ zi snippet OMZP::rake+ zi snippet OMZP::rbenv+ zi snippet OMZP::ruby

If it consists of a single file, with ZI you can just load it: zi snippet <some/path/or/url/undled-snnippets.zsh

Use zi ice svn if multiple files require an entire subdirectory.

zi ice svnzi snippet OMZP::gitfastzi ice svnzi snippet OMZP::osx

Use zi ice as"completion" to directly add single file completion snippets.

zi ice as"completion"zi snippet OMZP::docker/_dockerzi ice as"completion"zi snippet OMZP::fd/_fd

You can see an extended explanation of OMZ setup in the Wiki

OMZ Themes

Themes are stored in the themes directory. All and loaded in the background. with the simple syntax:

ZSH_THEME="robbyrussell"

However, ZI doesn't support the ZSH_THEME variable natively.

To use themes created for OMZ, it requires loading shown below as it would be the same as OMZ does in the background.

Some themes may require additional configuration it can be determined from the theme configuration file.

  • Load Git library
  • Load Git plugin
  • Enable setopt promptsubst

If any of the above are not in order or missing, the theme will break similar as shown below:

$(build_prompt)

If the Git library is not loaded or loaded in the wrong order, then it may appear similar to the following:

........:1: command not found: git_prompt_status........:1: command not found: git_prompt_short_sha

All together it looks like this:

zi snippet OMZL::git.zshzi snippet OMZP::gitzi cdclear -q

Then load the prompt:

setopt promptsubstzi snippet OMZT::robbyrussell

External theme sample: NicoSantangelo/Alpharized

Load with OMZ:

ZSH_THEME="alpharized"

Load with ZI:

zi snippet OMZL::git.zsh

Load Git plugin from OMZ:

zi snippet OMZP::gitzi cdclear -qsetopt promptsubstzi light NicoSantangelo/Alpharized

Prezto basics

Raw Syntax with URL:

zi snippet <URL>

Shorthand PZT: https://github.com/sorin-ionescu/prezto/tree/master/

zi snippet PZT::<PATH>

Shorthand PZT/modules:

zi snippet PZTM::<PATH>

Prezto modules

Importing the environment and terminal Prezto Modules Sample:

Prezto Setting:

zstyle ':prezto:load' pmodule 'environment' 'terminal'

ZI Setting:

Import raw syntax from URL.

zi snippet https://github.com/sorin-ionescu/prezto/blob/master/modules/environment/init.zshzi snippet https://github.com/sorin-ionescu/prezto/blob/master/modules/terminal/init.zsh

PZT Shorthand Syntax:

zi snippet PZT::modules/environmentzi snippet PZT::modules/terminal

PZTM Shorthand Syntax:

zi snippet PZTM::environmentzi snippet PZTM::terminal

Use zi ice svn if multiple files require an entire subdirectory.

zi ice svnzi snippet PZTM::dockerzi ice svnzi snippet PZTM::git

Use zi ice as"null" if don't exist *.plugin.zsh, init.zsh, *.zsh-theme* files in module.

zi ice svn as"null"zi snippet PZTM::archive

Use zi ice atclone"git clone <repo> <location>" if module have external module.

zi ice svn blockf \  atclone"git clone --recursive https://github.com/zsh-users/zsh-completions.git external"zi snippet PZTM::completion

Use blockf to prevent any unnecessary additions to fpath, as ZI manages fpath.

tip

What is zstyle?

Zgen

Load OMZ library

- zgen oh-my-zsh+ zi snippet OMZL::<ANY OF THEM>

Load OMZ plugins

- zgen oh-my-zsh <PATH>+ zi snippet OMZP::<PATH>

Load Prezto modules

- zgen prezto+ zi snippet PZTM::<ANY FROM LIST BELOW>
  • environment
  • terminal
  • editor
  • history
  • directory
  • spectrum
  • utility
  • completion
  • prompt
- zgen prezto <modulename>+ zi snippet PZTM::<modulename>

Load repositories as prezto plugins:

- zgen pmodule <reponame> <branch>+ zi ice ver"<branch>"+ zi load <repo/plugin>

Summarized Zgen

info

For the location: refer selection of files

- zgen load <repo> [location] [branch]+ zi ice ver"[branch]"+ zi load <repo>

Zplug Basics

- zplug <repo/plugin>, tag1:<option1>, tag2:<option2>+ zi ice tag1"<option1>" tag2"<option2>"+ zi load <repo/plugin>

Tag comparison

  • as => as
  • use => pick, src, multisrc
  • ignore => None
  • from => from
  • at => ver
  • rename-to => mv, cp
  • dir => Selection(pick, …) with rename
  • if => if
  • hook-build => atclone, atpull
  • hook-load => atload
  • frozen => None
  • on => None
  • defer => wait
  • lazy => autoload
  • depth => depth