From 344c7abe1ccd335333db10341117e23eaa35169b Mon Sep 17 00:00:00 2001 From: Sall <59910950+ss-o@users.noreply.github.com> Date: Fri, 15 May 2026 23:32:43 +0100 Subject: [PATCH 1/7] Update available meta-plugins list in documentation (#724) docs(annexes): update available meta-plugins list Signed-off-by: Salvydas Lukosius Co-authored-by: Salvydas Lukosius --- ecosystem/annexes/2_meta_plugins.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecosystem/annexes/2_meta_plugins.mdx b/ecosystem/annexes/2_meta_plugins.mdx index 412a59881..8fd726dab 100644 --- a/ecosystem/annexes/2_meta_plugins.mdx +++ b/ecosystem/annexes/2_meta_plugins.mdx @@ -62,7 +62,7 @@ zi light-mode for @annexes \ | @ext-git | [git-open][], [git-recent][], [git-my][], [git-quick-stats][], [git-now][], [git-extras][], [forgit][] | | @fuzzy | [fzf][] (package), [fzy][] (package), [skim][], [peco][] | | @fuzzy-src | fzf-go, [fzy][], skim-cargo, peco-go | -| @prezto | PZTM::archive, PZTM::directory, PZTM::utility | +| @ohmyzsh-lib | OMZL::git, OMZL::history, OMZL::vcs_info, OMZL::clipboard, OMZL::completion, OMZL::theme-and-appearance, OMZL::prompt_info_functions, OMZL::termsupport, OMZL::key-bindings, OMZL::compfix, OMZL::directories, OMZL::functions | | @py-utils | [pyenv][] (package) | | @romkatv | [powerlevel10k][] | | @rust-utils | rust-toolchain, cargo-extensions | From 7ebe1decb969925e800e4a5fef8527f2cafda111 Mon Sep 17 00:00:00 2001 From: Salvydas Lukosius Date: Sun, 17 May 2026 02:54:02 +0100 Subject: [PATCH 2/7] feat(highlight): add custom ZSH Prism language with zi/zunit tokens - Creates src/prism/prism-zsh.js extending bash grammar - Registers ZSH builtins (setopt, autoload, compinit, zstyle, bindkey, typeset, unsetopt, zle, zmodload, zstyle, zcompile, etc.) as builtin tokens - Registers zi and zunit as keyword tokens for distinct highlighting - Adds ZSH parameter expansion flag pattern ${(flags)var} - Swizzles prism-include-languages to load the custom grammar Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/prism/prism-zsh.js | 41 ++++++++++++++++++++++++++++ src/theme/prism-include-languages.js | 30 ++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 src/prism/prism-zsh.js create mode 100644 src/theme/prism-include-languages.js diff --git a/src/prism/prism-zsh.js b/src/prism/prism-zsh.js new file mode 100644 index 000000000..124c926ea --- /dev/null +++ b/src/prism/prism-zsh.js @@ -0,0 +1,41 @@ +// Custom Prism language definition for ZSH. +// Extends Prism's bash grammar with ZSH-specific builtins and project commands. +(function (Prism) { + // Clone bash grammar as the base + Prism.languages.zsh = Prism.languages.extend('bash', {}); + + // Insert ZSH builtins and project commands BEFORE bash's 'function' token + // so they take priority over generic identifier matching. + Prism.languages.insertBefore('zsh', 'function', { + // ZSH plugin manager — highlight as keyword for distinct color + 'zi-command': { + pattern: /(^|[\s;|&])zi(?=\s|$)/, + lookbehind: true, + alias: 'keyword', + }, + + // ZSH unit testing framework + 'zunit-command': { + pattern: /(^|[\s;|&])zunit(?=\s|$)/, + lookbehind: true, + alias: 'keyword', + }, + + // ZSH-specific builtins not present (or not highlighted) in bash + 'zsh-builtin': { + pattern: + /(^|[\s;|&])(?:autoload|bindkey|builtin|compctl|compdump|compinit|compdef|compfiles|compgroups|compquote|comptags|comptry|compvalues|declare|dirs|disable|disown|emulate|enable|fc|float|functions|getcap|getln|getopts|history|integer|jobs|let|limit|local|log|noglob|popd|print|printf|pushd|pushln|pwd|read|readonly|sched|set|setcap|setopt|shift|source|stat|suspend|ttyctl|type|typeset|ulimit|umask|unalias|unfunction|unhash|unlimit|unset|unsetopt|vared|wait|whence|where|which|zcompile|zformat|zle|zmodload|zparseopts|zpty|zregexparse|zsocket|zstyle|ztcp)(?=\s|$)/, + lookbehind: true, + alias: 'builtin', + }, + }); + + // ZSH parameter expansion flags: ${(U)var}, ${(f)var}, ${(P)var}, etc. + // Insert before 'variable' so flag notation gets its own token. + Prism.languages.insertBefore('zsh', 'variable', { + 'zsh-expansion-flag': { + pattern: /\$\{\([^)]*\)/, + alias: 'attr-value', + }, + }); +})(Prism); diff --git a/src/theme/prism-include-languages.js b/src/theme/prism-include-languages.js new file mode 100644 index 000000000..51326ade3 --- /dev/null +++ b/src/theme/prism-include-languages.js @@ -0,0 +1,30 @@ +// Swizzled Docusaurus prism-include-languages. +// Loads standard additionalLanguages from prismjs, then registers the custom ZSH grammar. +import siteConfig from '@generated/docusaurus.config'; + +export default function prismIncludeLanguages(PrismObject) { + const { + themeConfig: {prism}, + } = siteConfig; + const {additionalLanguages} = prism; + + // Mount PrismObject on globalThis temporarily — prismjs components expect it there. + const PrismBefore = globalThis.Prism; + globalThis.Prism = PrismObject; + + additionalLanguages.forEach((lang) => { + if (lang === 'php') { + require('prismjs/components/prism-markup-templating.js'); + } + require(`prismjs/components/prism-${lang}`); + }); + + // Register custom ZSH grammar (must load after bash, which is in additionalLanguages) + require('../prism/prism-zsh.js'); + + // Restore globalThis.Prism + delete globalThis.Prism; + if (typeof PrismBefore !== 'undefined') { + globalThis.Prism = PrismBefore; + } +} From da340ca13909ad82afa78ad07395553be4cd0c87 Mon Sep 17 00:00:00 2001 From: Salvydas Lukosius Date: Sun, 17 May 2026 02:54:08 +0100 Subject: [PATCH 3/7] docs: migrate ZSH-specific shell code blocks to zsh language All 49 docs files with ZSH-specific content (zi, setopt, autoload, compinit, zstyle, bindkey, zle, etc.) now use the `zsh` language identifier for proper syntax highlighting. Generic POSIX shell one-liners (curl install commands) remain as `shell`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../01_zsh_guide/01_roadmap/10_expansion.mdx | 4 +- community/02_zsh_plugin_standard.mdx | 10 +- .../03_zsh_native_scripting_handbook.mdx | 6 +- .../gallery/collection/01_collection.mdx | 2 +- .../gallery/collection/02_completions.mdx | 48 +++--- community/gallery/collection/03_programs.mdx | 146 +++++++++--------- community/gallery/collection/04_snippets.mdx | 6 +- community/gallery/collection/05_services.mdx | 4 +- community/gallery/collection/06_plugins.mdx | 54 +++---- community/gallery/collection/07_themes.mdx | 38 ++--- docs/getting_started/01_installation.mdx | 12 +- docs/getting_started/02_overview.mdx | 70 ++++----- docs/getting_started/03_migration.mdx | 30 ++-- docs/guides/01_commands.mdx | 18 +-- docs/guides/02_customization.mdx | 18 +-- docs/guides/03_benchmark.mdx | 6 +- docs/guides/syntax/01_standard.mdx | 90 +++++------ docs/guides/syntax/02_for.mdx | 20 +-- docs/guides/syntax/10_bindkey.mdx | 16 +- ecosystem/annexes/0_overview.mdx | 10 +- ecosystem/annexes/19_eval.mdx | 14 +- ecosystem/annexes/1_bin_gem_node.mdx | 48 +++--- ecosystem/annexes/20_test.mdx | 6 +- ecosystem/annexes/2_meta_plugins.mdx | 10 +- ecosystem/annexes/3_default_ice.mdx | 6 +- ecosystem/annexes/4_patch-dl.mdx | 8 +- ecosystem/annexes/5_readurl.mdx | 14 +- ecosystem/annexes/6_submods.mdx | 4 +- ecosystem/annexes/7_unscope.mdx | 2 +- ecosystem/annexes/8_linkbin.mdx | 6 +- ecosystem/annexes/9_rust.mdx | 18 +-- ecosystem/packages/01_synopsis.mdx | 10 +- ecosystem/packages/02_usage.mdx | 76 ++++----- ecosystem/plugins/diff-so-fancy.mdx | 4 +- ecosystem/plugins/f-sy-h.mdx | 4 +- ecosystem/plugins/h-s-mw.mdx | 8 +- ecosystem/plugins/zbrowse.mdx | 2 +- ecosystem/plugins/zconvey.mdx | 6 +- ecosystem/plugins/zi_console.mdx | 10 +- ecosystem/plugins/zprompts.mdx | 2 +- ecosystem/plugins/zsh_comand_architect.mdx | 2 +- ecosystem/plugins/zsh_editing_workbench.mdx | 2 +- ecosystem/plugins/zsh_modules.mdx | 8 +- ecosystem/plugins/zsh_navigation_tools.mdx | 8 +- ecosystem/plugins/zsh_select.mdx | 2 +- ecosystem/plugins/zsh_startify.mdx | 6 +- ecosystem/plugins/zsh_unique_id.mdx | 4 +- ecosystem/plugins/zui.mdx | 6 +- ecosystem/plugins/zzcomplete.mdx | 2 +- 49 files changed, 453 insertions(+), 453 deletions(-) diff --git a/community/01_zsh_guide/01_roadmap/10_expansion.mdx b/community/01_zsh_guide/01_roadmap/10_expansion.mdx index 84df12b39..583f6ef24 100644 --- a/community/01_zsh_guide/01_roadmap/10_expansion.mdx +++ b/community/01_zsh_guide/01_roadmap/10_expansion.mdx @@ -36,13 +36,13 @@ ls ~/**/*.txt # <- THIS IS A GLOB Enable the `extended_glob` option in Zsh: -```shell +```zsh setopt extended_glob ``` Enable the `dot_glob` option in Zsh: -```shell +```zsh setopt dot_glob ``` diff --git a/community/02_zsh_plugin_standard.mdx b/community/02_zsh_plugin_standard.mdx index a58c3399c..e3e9a37c8 100644 --- a/community/02_zsh_plugin_standard.mdx +++ b/community/02_zsh_plugin_standard.mdx @@ -315,7 +315,7 @@ The Zle editor is the part of the Zsh that is responsible for receiving the text The syntax of the call is: -```shell +```zsh add-zle-hook-widget [ -L | -dD ] [ -Uzk ] hook widget_name ``` @@ -352,7 +352,7 @@ This way all the data of all plugins will be kept in a single parameter, availab The following code snippet is recommended to be included at the beginning of each of the main functions provided by the plugin: -```shell showLineNumbers +```zsh showLineNumbers builtin emulate -L zsh ${=${options[xtrace]:#off}:+-o xtrace} builtin setopt extended_glob warn_create_global typeset_silent no_short_loops rc_quotes no_auto_pushd ``` @@ -461,7 +461,7 @@ When the main function finishes executing, the functions are left defined. This The following snippet of code, when added at the beginning of the main function will automatically unset the sub-functions when leaving the main function to don't leak any functions into the global namespace: -```shell showLineNumbers +```zsh showLineNumbers typeset -g prjef prjef=( ${(k)functions} ) trap "unset -f -- \"\${(k)functions[@]:|prjef}\" &>/dev/null; unset prjef" EXIT @@ -482,7 +482,7 @@ When writing a plugin one often needs to keep a state during the Zsh session. To With the following method, only a single global parameter per plugin can be sufficient: -```shell showLineNumbers +```zsh showLineNumbers typeset -A PlgMap typeset -A SomeMap typeset -a some_array @@ -494,7 +494,7 @@ some_array[1]=state can be converted into: -```shell showLineNumbers +```zsh showLineNumbers typeset -A PlgMap PlgMap[state]=1 diff --git a/community/03_zsh_native_scripting_handbook.mdx b/community/03_zsh_native_scripting_handbook.mdx index 8c7b5f718..8655f486b 100644 --- a/community/03_zsh_native_scripting_handbook.mdx +++ b/community/03_zsh_native_scripting_handbook.mdx @@ -118,7 +118,7 @@ This requires `extended_glob`. The `(#s)` means: "start of the string". So `((#s If the `extended_glob` option cannot be used for some reason, this can be achieved also without it, but essentially it means that the alternative (i.e. `|`) of two versions of the pattern will have to be matched: -```shell showLineNumbers +```zsh showLineNumbers setopt local_options no_extended_glob local git_status="$(git status --porcelain)" nl=$'\n' if [[ "$git_status" = (\?\?*|*$nl\?\?*) ]]; then @@ -145,7 +145,7 @@ The `~` is a negation -- `match \*abc* but not ...`. Then, `^` is also a negatio ### Skipping tr {/* #skipping-tr */} -```shell showLineNumbers +```zsh showLineNumbers typeset -A map; map=( a 1 b 2 ); text=( "ab" "ba" ) text=( ${text[@]//(#m)?/${map[$MATCH]}} ) @@ -246,7 +246,7 @@ Use of the `#b` glob flag enables math-code execution (and not only) in `/` and ### Serializing data {/* #serializing-data */} -```shell showLineNumbers +```zsh showLineNumbers typeset -A hsh deserialized; hsh=( key value ) serialized="${(j: :)${(qkv@)hsh}}" deserialized=( "${(Q@)${(z@)serialized}}" ) diff --git a/community/gallery/collection/01_collection.mdx b/community/gallery/collection/01_collection.mdx index 4273d0785..ed449c1cd 100644 --- a/community/gallery/collection/01_collection.mdx +++ b/community/gallery/collection/01_collection.mdx @@ -18,7 +18,7 @@ keywords: - Additional installation methods: [meta-plugins](/ecosystem/annexes/meta-plugins), [packages][]. - Some installations may require additional functionally, it can be done by installing required [annexes][]: -```shell +```zsh zi light-mode for z-shell/z-a-meta-plugins @annexes ``` diff --git a/community/gallery/collection/02_completions.mdx b/community/gallery/collection/02_completions.mdx index 54497432f..43ed6f084 100644 --- a/community/gallery/collection/02_completions.mdx +++ b/community/gallery/collection/02_completions.mdx @@ -38,7 +38,7 @@ Create your own syntax e.g: > - The ver'main' - allows selecting a specific version or branch. > - It's optional and can be removed if not required. -```shell showlinenumbers +```zsh showlinenumbers z_lucid() { zi ice lucid ver'main' "$@" } @@ -58,7 +58,7 @@ zi_completion() { Then load as: -```shell showlinenumbers +```zsh showlinenumbers zi_completion has'…' zi snippet … @@ -73,28 +73,28 @@ zi snippet … ### COMP: [alacritty/alacritty][] {/* #comp-alacritty-alacritty */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'alacritty' zi snippet https://github.com/alacritty/alacritty/blob/master/extra/completions/_alacritty ``` ### COMP: [Aloxaf/fzf-tab][] {/* #comp-aloxaf-fzf-tab */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait has'fzf' zi light Aloxaf/fzf-tab ``` ### COMP: [beetbox/beets][] {/* #comp-beetbox-beets */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'beet' zi snippet https://github.com/beetbox/beets/blob/master/extra/_beet ``` ### COMP: [bugaevc/wl-clipboard](https://github.com/bugaevc/wl-clipboard/tree/master/completions/zsh/) {/* #comp-bugaevc-wl-clipboard */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'wl-copy' zi snippet https://github.com/bugaevc/wl-clipboard/blob/master/completions/zsh/_wl-copy @@ -104,126 +104,126 @@ zi snippet https://github.com/bugaevc/wl-clipboard/blob/master/completions/zsh/_ ### COMP: [BurntSushi/ripgrep/rg](https://github.com/BurntSushi/ripgrep/blob/master/crates/core/flags/complete/rg.zsh) {/* #comp-burntsushi-ripgrep-rg */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'rg' mv'rg.zsh -> _rg' zi snippet https://github.com/BurntSushi/ripgrep/blob/master/crates/core/flags/complete/rg.zsh ``` ### COMP: [dbrgn/tealdeer][dbrgn-tealdeer] {/* #comp-dbrgn-tealdeer */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'tldr' mv'zsh_tealdeer -> _tldr' zi snippet https://github.com/dbrgn/tealdeer/blob/main/completion/zsh_tealdeer ``` ### COMP: [docker/cli][] {/* #comp-docker-cli */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as"completion" zi snippet https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker ``` ### COMP: [flatpak/flatpak][] {/* #comp-flatpak-flatpak */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'flatpak' zi light https://github.com/flatpak/flatpak/blob/master/completion/_flatpak ``` ### COMP: [git/git][] {/* #comp-git-git */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf mv'git-completion.zsh -> _git' zi snippet https://github.com/git/git/blob/master/contrib/completion/git-completion.zsh ``` ### COMP: [greymd/tmux-xpanes][] {/* #comp-greymd-tmux-xpanes */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'tmux' pick'completion/zsh' zi light greymd/tmux-xpanes ``` ### COMP: [jarun/Buku][] {/* #comp-jarun-Buku */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'buku' zi snippet https://github.com/jarun/Buku/blob/master/auto-completion/zsh/_buku ``` ### COMP: [mpv-player/mpv][] {/* #comp-mpv-player-mpv */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'mpv' zi snippet https://github.com/mpv-player/mpv/blob/master/etc/_mpv.zsh ``` ### COMP: [ohmyzsh/rust][] {/* #comp-ohmyzsh-rust */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'rustc' zi snippet https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/rust/_rustc ``` ### COMP: [oven-sh/bun][] {/* #comp-oven-sh-bun */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'bun' zi snippet https://github.com/oven-sh/bun/blob/main/completions/bun.zsh ``` ### COMP: [rust-lang/cargo][] {/* #comp-rust-lang-cargo */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'cargo' zi snippet https://github.com/rust-lang/cargo/blob/master/src/etc/_cargo ``` ### COMP: [srijanshetty/zsh-pandoc-completion][] {/* #comp-srijanshetty-zsh-pandoc-completion */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'pandoc' zi light srijanshetty/zsh-pandoc-completion ``` ### COMP: [TheLocehiliosan/yadm](https://github.com/yadm-dev/yadm/blob/master/completion/zsh/_yadm) {/* #comp-TheLocehiliosan-yadm */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'yadm' zi snippet https://github.com/yadm-dev/yadm/blob/master/completion/zsh/_yadm ``` ### COMP: [x-motemen/ghq][] {/* #comp-x-motemen-ghq */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'ghq' zi snippet https://github.com/x-motemen/ghq/blob/master/misc/zsh/_ghq ``` ### COMP: [zchee/zsh-completions][] {/* #comp-zchee-zsh-completions */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf zi light zchee/zsh-completions ``` ### [ajeetdsouza/zoxide](https://github.com/ajeetdsouza/zoxide/blob/main/contrib/completions/_zoxide) {/* #comp-zoxide-completions */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid as'completion' blockf has'zoxide' zi snippet https://github.com/ajeetdsouza/zoxide/blob/main/contrib/completions/_zoxide ``` ### COMP: [zsh-users/zsh-completions][] {/* #comp-zsh-users-zsh-completions */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' zi light zsh-users/zsh-completions ``` ### COMP: Local {/* #comp-local */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'completion' blockf has'pip' zi snippet "$SHELL_COMMON/zsh/completions/_pip" diff --git a/community/gallery/collection/03_programs.mdx b/community/gallery/collection/03_programs.mdx index 32113646a..73c72049c 100644 --- a/community/gallery/collection/03_programs.mdx +++ b/community/gallery/collection/03_programs.mdx @@ -46,7 +46,7 @@ The `ver'…'` - allows to select a specific version, branch, or commit hash, al Example: -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid for \ ver'88f3dae4f5391db589257ea069ab8fe4717c22c6' \ z-shell/F-Sy-H @@ -58,7 +58,7 @@ zi wait lucid for \ Command wrap example for cleaner or preferred syntax. -```shell showLineNumbers +```zsh showLineNumbers z_lucid() { zi ice lucid ver'master' "$@" } @@ -74,7 +74,7 @@ zi_program() { Then load as: -```shell showLineNumbers +```zsh showLineNumbers zi_program has'…' zi light … @@ -96,7 +96,7 @@ zi light … -```shell showLineNumbers +```zsh showLineNumbers zi ice has'asciinema' as'program' from'gh-r' \ mv'agg* -> agg' pick'agg' zi light asciinema/agg @@ -107,7 +107,7 @@ zi light asciinema/agg Install using the [bin-gem-node][bin-gem-node] annex. -```shell showLineNumbers +```zsh showLineNumbers zi ice has'asciinema' as'program' from'gh-r' sbin'agg* -> agg' zi light asciinema/agg ``` @@ -117,77 +117,77 @@ zi light asciinema/agg ### GH-R: [dandavison/delta][] {/* #dandavison-delta */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid as'program' from'gh-r' sbin'**/delta -> delta' zi light dandavison/delta ``` ### GH-R: [denisidoro/navi][] {/* #gh-r-denisidoronavi */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' from"gh-r" has'fzf' zi light denisidoro/navi ``` ### GH-R: [junegunn/fzf][] {/* #gh-r-junegunnfzf */} -```shell showLineNumbers +```zsh showLineNumbers zi ice from'gh-r' as'program' zi light junegunn/fzf ``` ### GH-R: [sharkdp/fd][] {/* #gh-r-sharkdpfd */} -```shell showLineNumbers +```zsh showLineNumbers zi ice from'gh-r' as'program' mv'fd* fd' sbin'**/fd(.exe|) -> fd' zi light @sharkdp/fd ``` ### GH-R: [sharkdp/bat][] {/* #gh-r-sharkdpbat */} -```shell showLineNumbers +```zsh showLineNumbers zi ice from'gh-r' as'program' mv'bat* bat' sbin'**/bat(.exe|) -> bat' zi light @sharkdp/bat ``` ### GH-R: [sharkdp/hexyl][] {/* #gh-r-sharkdphexyl */} -```shell showLineNumbers +```zsh showLineNumbers zi ice from'gh-r' as'program' mv'hexyl* hexyl' sbin'**/hexyl(.exe|) -> hexyl' zi light @sharkdp/hexyl ``` ### GH-R: [sharkdp/hyperfine][] {/* #gh-r-sharkdphyperfine */} -```shell showLineNumbers +```zsh showLineNumbers zi ice from'gh-r' as'program' mv"hyperfine* hyperfine" sbin"**/hyperfine(.exe|) -> hyperfine" zi light @sharkdp/hyperfine ``` ### GH-R: [sharkdp/vivid][] {/* #gh-r-sharkdpvivid */} -```shell showLineNumbers +```zsh showLineNumbers zi ice from'gh-r' as'program' mv'vivid* vivid' sbin'**/vivid(.exe|) -> vivid' zi light @sharkdp/vivid ``` ### GH-R: [ogham/exa][] {/* #gh-r-oghamexa */} -```shell showLineNumbers +```zsh showLineNumbers zi ice from'gh-r' as'program' sbin'**/exa -> exa' atclone'cp -vf completions/exa.zsh _exa' zi light ogham/exa ``` ### GH-R: [docker/compose][] {/* #gh-r-dockercompose */} -```shell showLineNumbers +```zsh showLineNumbers zi ice from"gh-r" as'program' mv'docker* -> docker-compose' zi light docker/compose ``` ### GH-R: [neovim/neovim][] {/* #gh-r-neovimneovim */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' from'gh-r' \ bpick'nvim-linux64.tar.gz' sbin'**/bin/nvim -> nvim' zi light neovim/neovim @@ -195,28 +195,28 @@ zi light neovim/neovim ### GH-R: [direnv/direnv][] {/* #gh-r-direnvdirenv */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' from'gh-r' mv'direnv* -> direnv' zi light direnv/direnv ``` ### GH-R: [mvdan/sh][] {/* #gh-r-mvdansh */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' from'gh-r' mv'shfmt* -> shfmt' zi light mvdan/sh ``` ### GH-R: [b4b4r07/gotcha][] {/* #gh-r-b4b4r07gotcha */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' from'gh-r' mv'gotcha_* -> gotcha' zi light b4b4r07/gotcha ``` ### GH-R: [ajeetdsouza/zoxide][] {/* #gh-r-ajeetdsouzazoxide */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' from'gh-r' pick'zoxide' \ atclone'ln -s completions/_zoxide -> _zoxide; cp man/man1/*.1 $ZI[MAN_DIR]/man1; ./zoxide init zsh --cmd x > init.zsh' \ @@ -226,28 +226,28 @@ zi light ajeetdsouza/zoxide ### SC: [zdharma/revolver][] {/* #sc-zdharmarevolver */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid as'program' pick'revolver' zi light zdharma/revolver ``` ### SC: [zdharma/zunit][] {/* #sc-zdharmazunit */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid as'program' pick'zunit' atclone'./build.zsh' atpull'%atclone' zi load zdharma/zunit ``` ### SC: [Osse/git-scripts/git-unique][] {/* #sc-ossegit-scriptsgit-unique */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' id-as'git-unique' pick'git-unique' zi snippet https://github.com/Osse/git-scripts/blob/master/git-unique ``` ### SC: [mfaerevaag/wd][] {/* #sc-mfaerevaagwd */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid as'program' cp'wd.sh -> wd' \ mv'_wd.sh -> _wd' atpull'!git reset --hard' pick'wd' zi light mfaerevaag/wd @@ -255,28 +255,28 @@ zi light mfaerevaag/wd ### SC: [z-shell/zsh-diff-so-fancy][] {/* #sc-z-shellzsh-diff-so-fancy */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid as'program' pick'bin/git-dsf' zi load z-shell/zsh-diff-so-fancy ``` ### SC: [obihann/archey-osx][] {/* #sc-obihannarchey-osx */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid as'program' pick'bin/archey' zi light obihann/archey-osx ``` ### SC: [eth-p/bat-extras][] {/* #sc-eth-pbat-extras */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'bat' pick'src/*' zi light eth-p/bat-extras ``` ### SC: [paulirish/git-open][] {/* #sc-paulirishgit-open */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'git' \ atclone"cp git-open.1.md $ZI[MAN_DIR]/man1/git-open.1" atpull'%atclone' zi light paulirish/git-open @@ -284,38 +284,38 @@ zi light paulirish/git-open ### SC: [LuRsT/hr][] {/* #sc-lursthr */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' atclone"cp hr.1 $ZI[MAN_DIR]/man1" atpull'%atclone' zi light LuRsT/hr ``` ### SC: [Seirdy/stpv][] {/* #sc-seirdystpv */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'fzf' pick'fzfp' zi light Seirdy/stpv ``` -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'ueberzug' pick'stpvimg' zi light Seirdy/stpv ``` -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' pick'stpv' zi light Seirdy/stpv ``` ### SC: [exiftool/exiftool][] {/* #sc-exiftoolexiftool */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'perl' has'convert' pick'exiftool' zi light exiftool/exiftool ``` ### SC: [smxi/inxi][] {/* #sc-smxiinxi */} -```shell showLineNumbers +```zsh showLineNumbers zi ice if'[ -z "$SSH_CONNECTION" ]' lucid wait \ as'program' has'perl' pick'inxi' zi light smxi/inxi @@ -323,35 +323,35 @@ zi light smxi/inxi ### SC: [dylanaraps/pash][] {/* #sc-dylanarapspash */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'gpg' zi light dylanaraps/pash ``` ### SC: [hackerb9/lsix][] {/* #sc-hackerb9lsix */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'mogrify' zi light hackerb9/lsix ``` ### SC: [denilsonsa/prettyping][] {/* #sc-denilsonsaprettyping */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' pick'prettyping' has'ping' zi light denilsonsa/prettyping ``` ### SC: [greymd/tmux-xpanes][] {/* #sc-greymdtmux-xpanes */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'tmux' pick'bin/xpanes' zi light greymd/tmux-xpanes ``` ### SC: [DanielG/dxld-mullvad/am-i-mullvad.sh][] {/* #sc-danielgdxld-mullvadam-i-mullvadsh */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'jq' zi snippet 'https://github.com/DanielG/dxld-mullvad/blob/master/am-i-mullvad.sh' ``` @@ -360,7 +360,7 @@ zi snippet 'https://github.com/DanielG/dxld-mullvad/blob/master/am-i-mullvad.sh' Standard syntax -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid as'program' atclone"autoreconf -i; ./configure --prefix=$ZPFX" \ atpull'%atclone' make"install" pick"$ZPFX/bin/cmatrix" zi light abishekvashok/cmatrix @@ -368,7 +368,7 @@ zi light abishekvashok/cmatrix The "for" syntax -```shell showLineNumbers +```zsh showLineNumbers zi for as'program' atclone"autoreconf -i; ./configure --prefix=$ZPFX" \ atpull'%atclone' make"all install" pick"$ZPFX/bin/cmatrix" \ abishekvashok/cmatrix @@ -376,14 +376,14 @@ zi for as'program' atclone"autoreconf -i; ./configure --prefix=$ZPFX" \ ### B: [tj/git-extras][] {/* #b-tjgit-extras */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid as'program' pick'$ZPFX/bin/git-*' make'PREFIX=$ZPFX' nocompile zi light tj/git-extras ``` ### B: [k4rthik/git-cal][] {/* #b-k4rthikgit-cal */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid as'program' atclone'perl Makefile.PL PREFIX=$ZPFX' \ atpull'%atclone' make'install' pick'$ZPFX/bin/git-cal' zi light k4rthik/git-cal @@ -391,28 +391,28 @@ zi light k4rthik/git-cal ### B: [aaronNG/reddio][] {/* #b-aaronngreddio */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'jq' pick'reddio' from'gitlab' zi light aaronNG/reddio ``` ### B: [TheLocehiliosan/yadm][] {/* #b-thelocehiliosanyadm */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' has'git' pick'yadm' atclone"cp yadm.1 $ZI[MAN_DIR]/man1" atpull'%atclone' zi light TheLocehiliosan/yadm ``` ### B: [sdushantha/farge][] {/* #b-sdushanthafarge */} -```shell showLineNumbers +```zsh showLineNumbers zi ice if'[[ -n "$WAYLAND_DISPLAY" ]]' lucid wait as'program' pick'farge' zi light 'sdushantha/farge' ``` ### B: [dylanaraps/neofetch][] {/* #b-dylanarapsneofetch */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid wait as'program' pick'neofetch' \ atclone"cp neofetch.1 $ZI[MAN_DIR]/man1" atpull'%atclone' zi light dylanaraps/neofetch @@ -420,7 +420,7 @@ zi light dylanaraps/neofetch ### B: [vim/vim][] {/* #b-vimvim */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' atclone'rm -f src/auto/config.cache; ./configure' \ atpull'%atclone' make pick'src/vim' zi light vim/vim @@ -428,7 +428,7 @@ zi light vim/vim ### B: [direnv/direnv][] {/* #b-direnvdirenv */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' make'!' atclone'./direnv hook zsh > zhook.zsh' \ atpull'%atclone' src'zhook.zsh' zi light direnv/direnv @@ -436,14 +436,14 @@ zi light direnv/direnv ### B: [mptre/yank][] {/* #b-mptreyank */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' pick'yank' make zi light mptre/yank ``` ### B: [pyenv/pyenv][] {/* #b-pyenvpyenv */} -```shell showLineNumbers +```zsh showLineNumbers zi ice atclone'PYENV_ROOT="$PWD" ./libexec/pyenv init - > zpyenv.zsh' \ atinit'export PYENV_ROOT="$PWD"' atpull"%atclone" \ as'program' pick'bin/pyenv' src"zpyenv.zsh" nocompile'!' @@ -452,7 +452,7 @@ zi light pyenv/pyenv ### B: [sdkman/sdkman-cli][] {/* #b-sdkmansdkman-cli */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' pick'$ZPFX/sdkman/bin/sdk' id-as'sdkman' run-atpull nocompile \ atclone'curl -s "https://get.sdkman.io?rcupdate=false" -o scr.sh; SDKMAN_DIR=$ZPFX/sdkman bash scr.sh' \ atpull'SDKMAN_DIR=$ZPFX/sdkman sdk selfupdate' \ @@ -462,7 +462,7 @@ zi light z-shell/0 ### B: [asciinema/asciinema][] {/* #b-asciinemaasciinema */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as"program" wait lucid atinit"export PYTHONPATH=$ZPFX/lib/python3.10/site-packages/" \ atclone"PYTHONPATH=$ZPFX/lib/python3.10/site-packages/ python3 setup.py --quiet install --prefix $ZPFX" \ atpull"%atclone" test"0" pick"$ZPFX/bin/asciinema" @@ -471,7 +471,7 @@ zi load asciinema/asciinema ### RA: Rust and [Peltoche/lsd][] {/* #ra-rust-and-peltochelsd */} -```shell showLineNumbers +```zsh showLineNumbers zi ice rustup cargo'!lsd' id-as'lsd' as'program' nocompile zi load z-shell/0 ``` @@ -480,28 +480,28 @@ zi load z-shell/0 The `ls` shim exposing the `exa`` binary -```shell showLineNumbers +```zsh showLineNumbers zi ice rustup cargo'!exa -> ls' id-as'exa' as'program' nocompile zi load z-shell/0 ``` Shim with standard error redirected to `/dev/null` -```shell showLineNumbers +```zsh showLineNumbers zi ice rustup cargo'!E:exa' id-as'exa' as'program' nocompile zi load z-shell/0 ``` ### RA: Rust and [ogham/exa][], [Peltoche/lsd][] {/* #ra-rust-and-oghamexa-peltochelsd */} -```shell showLineNumbers +```zsh showLineNumbers zi ice rustup cargo'exa;lsd' nocompile zi load z-shell/0 ``` Expose binaries by altering $PATH: -```shell showLineNumbers +```zsh showLineNumbers zi ice rustup cargo'exa;lsd' as'program' pick"bin/(exa|lsd)" nocompile zi load z-shell/0 ``` @@ -510,7 +510,7 @@ zi load z-shell/0 Install rust and make it available globally in the system: -```shell showLineNumbers +```zsh showLineNumbers zi ice id-as"rust" wait"0" lucid rustup as"program" pick"bin/rustc" \ atload="export nocompile CARGO_HOME=\$PWD RUSTUP_HOME=\$PWD/rustup" zi load z-shell/0 @@ -520,7 +520,7 @@ zi load z-shell/0 ### GH-R: [argoproj/argo-cd](https://github.com/argoproj/argo-cd) {/* #gh-r-argoprojargo-cd */} -```shell showLineNumbers +```zsh showLineNumbers zi light-mode for \ as'completions' atclone'./argocd* completion zsh > _argocd' \ atpull'%atclone' from'gh-r' if'[[ "$(uname -m)" == x86_64 ]]' \ @@ -530,7 +530,7 @@ zi light-mode for \ ### GH-R: [junegunn/fzf][] + extras {/* #gh-r-junegunnfzf--extras */} -```shell showLineNumbers +```zsh showLineNumbers zi for atclone'mkdir -p $ZPFX/{bin,man/man1}' atpull'%atclone' from'gh-r' dl' https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh -> _fzf_completion; https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh -> key-bindings.zsh; @@ -542,7 +542,7 @@ zi for atclone'mkdir -p $ZPFX/{bin,man/man1}' atpull'%atclone' from'gh-r' dl' ### GH-R: [junegunn/fzf][], [sharkdp/fd][], [sharkdp/bat][], [ogham/exa][] {/* #gh-r-junegunnfzf-sharkdpfd-sharkdpbat-oghamexa */} -```shell showLineNumbers +```zsh showLineNumbers zi from"gh-r" as"null" for \ sbin"fzf" junegunn/fzf \ sbin"**/fd" @sharkdp/fd \ @@ -552,7 +552,7 @@ zi from"gh-r" as"null" for \ ### SC: [zdharma/revolver][], [zdharma/zunit][] {/* #sc-zdharmarevolver-zdharmazunit */} -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid for as'program' \ atclone'ln -sfv revolver.zsh-completion _revolver' \ atpull'%atclone' pick'revolver' \ @@ -564,7 +564,7 @@ zi wait lucid for as'program' \ ### SC: [tj/n](https://github.com/tj/n) {/* #sc-tjn */} -```shell showLineNumbers +```zsh showLineNumbers zi light-mode for as'program' atinit'export N_PREFIX="$PWD/n"; \ [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin"' pick"bin/n" \ tj/n @@ -581,7 +581,7 @@ zi light-mode for as'program' atinit'export N_PREFIX="$PWD/n"; \ ::: -```shell showLineNumbers +```zsh showLineNumbers zi light-mode for id-as'pnpm' from'gh-r' bpick'*-linux-x64' as'program' \ atinit'export PNPM_HOME=$ZPFX/bin; [[ -z $NODE_PATH ]] && \ export NODE_PATH=$PWD' sbin'pnpm* -> pnpm' nocompile \ @@ -590,7 +590,7 @@ zi light-mode for id-as'pnpm' from'gh-r' bpick'*-linux-x64' as'program' \ ### GH-R: [yarnpkg/yarn][] {/* #gh-r-yarnpkgyarn */} -```shell showLineNumbers +```zsh showLineNumbers zi light-mode for from'gh-r' as'program' \ atinit'export PATH="$HOME/.yarn/bin:$PATH"' mv'yarn* -> yarn' \ pick"yarn/bin/yarn" bpick'*.tar.gz' \ @@ -599,7 +599,7 @@ zi light-mode for from'gh-r' as'program' \ ### B: [jarun/nnn][] {/* #b-jarunnnn */} -```shell showLineNumbers +```zsh showLineNumbers zi light-mode for pick'misc/quitcd/quitcd.zsh' as'program' nocompile \ sbin make \ jarun/nnn @@ -607,7 +607,7 @@ zi light-mode for pick'misc/quitcd/quitcd.zsh' as'program' nocompile \ ### SC: [homebrew/brew][homebrew/brew] {/* #sc-homebrewbrewhomebrewbrew */} -```shell showLineNumbers +```zsh showLineNumbers zi for as'null' depth'3' nocompletions sbin'bin/brew' \ atclone'+zi-message "{auto}Installing brew …"; ./bin/brew update --preinstall; \ ln -sf $PWD/completions/zsh/_brew $ZI[COMPLETIONS_DIR]; \ @@ -619,7 +619,7 @@ zi for as'null' depth'3' nocompletions sbin'bin/brew' \ ### GH-R: [dbrgn/tealdeer](https://github.com/dbrgn/tealdeer) {/* #gh-r-dbrgntealdeer */} -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid as'program' from'gh-r' for \ mv'tealdeer* -> tealdeer' \ sbin'**/tealdeer -> tldr' \ @@ -629,7 +629,7 @@ zi wait lucid as'program' from'gh-r' for \ ### GH-R: [koalaman/shellcheck](https://github.com/koalaman/shellcheck) {/* #gh-r-koalamanshellcheck */} -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid as'program' from'gh-r' for \ mv'shellcheck* -> shellcheck' \ sbin'**/shellcheck -> shellcheck' \ @@ -638,7 +638,7 @@ zi wait lucid as'program' from'gh-r' for \ ### GH-R: [hadolint/hadolint](https://github.com/hadolint/hadolint) {/* #gh-r-hadolinthadolint */} -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid as'program' from'gh-r' for \ mv'hadolint* -> hadolint' \ sbin'hadolint -> hadolint' \ @@ -648,7 +648,7 @@ zi wait lucid as'program' from'gh-r' for \ ### RA: Rust compiler environment + completions {/* #ra-rust-compiler-environment--completions */} -```shell showLineNumbers +```zsh showLineNumbers zi id-as"rust" wait=1 as=null sbin="bin/*" lucid rustup nocompile \ atload="[[ ! -f ${ZI[COMPLETIONS_DIR]}/_cargo ]] && zi creinstall -q rust; \ export CARGO_HOME=\$PWD; export RUSTUP_HOME=\$PWD/rustup" for \ @@ -657,7 +657,7 @@ zi id-as"rust" wait=1 as=null sbin="bin/*" lucid rustup nocompile \ ### B: [ytdl-org/youtube-dl][ytdl-org/youtube-dl] {/* #b-ytdl-orgyoutube-dlytdl-orgyoutube-dl */} -```shell +```zsh zi for as'program' nocompile'!' depth'1' \ has'python' pick'$ZPFX/bin/youtube-dl*' make'!PREFIX=$ZPFX install' \ atclone'ln -sfv youtube-dl.zsh _youtube-dl' atpull'%atclone' \ diff --git a/community/gallery/collection/04_snippets.mdx b/community/gallery/collection/04_snippets.mdx index 7849fa650..c78d9677d 100644 --- a/community/gallery/collection/04_snippets.mdx +++ b/community/gallery/collection/04_snippets.mdx @@ -19,11 +19,11 @@ keywords: ### SC: [OMZ::lib/git.zsh](https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/git.zsh) {/* #sc-omzlib */} -```shell showLineNumbers +```zsh showLineNumbers zi snippet OMZL::git.zsh ``` -```shell showLineNumbers +```zsh showLineNumbers zi ice multisrc'git.zsh \ functions.zsh history.zsh grep.zsh' zi snippet OMZ::lib/completion.zsh @@ -31,7 +31,7 @@ zi snippet OMZ::lib/completion.zsh ### SC: [OMZ::plugin/macos](https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/macos/macos.plugin.zsh) {/* #sc-omzpluginmacos */} -```shell showLineNumbers +```zsh showLineNumbers zi snippet OMZP::macos ``` diff --git a/community/gallery/collection/05_services.mdx b/community/gallery/collection/05_services.mdx index 3588202f7..54721411d 100644 --- a/community/gallery/collection/05_services.mdx +++ b/community/gallery/collection/05_services.mdx @@ -13,14 +13,14 @@ keywords: ### ZS: [z-shell/redis](https://github.com/z-shell/redis) {/* #zs-z-shellredis */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid service"redis" zi light z-shell/redis ``` ### ZS: [z-shell/zsh-github-issues](https://github.com/z-shell/zsh-github-issues) {/* #zs-z-shellzsh-github-issues */} -```shell showLineNumbers +```zsh showLineNumbers GIT_SLEEP_TIME=700 GIT_PROJECTS=z-shell/zsh-github-issues:z-shell/zi diff --git a/community/gallery/collection/06_plugins.mdx b/community/gallery/collection/06_plugins.mdx index 35641c81e..02d8ac069 100644 --- a/community/gallery/collection/06_plugins.mdx +++ b/community/gallery/collection/06_plugins.mdx @@ -29,7 +29,7 @@ Related: Load in turbo mode and adjust loading order by appending e.g: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait'0a' lucid … zi light … @@ -47,7 +47,7 @@ zi light … - The ver'main' - allows to select specific commit, version or branch. - It's optional and can be removed if not required. -```shell showLineNumbers +```zsh showLineNumbers z_lucid() { zi ice lucid ver'main' "$@" } @@ -69,7 +69,7 @@ zi0c() { :::tip[Load:] -```shell showLineNumbers +```zsh showLineNumbers zi0a zi light … @@ -86,7 +86,7 @@ zi light … ### SC: [trapd00r/LS_COLORS](https://github.com/trapd00r/LS_COLORS) {/* #sc-trapd00rls_colors */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid reset \ atclone"[[ -z \${commands[dircolors]} ]] && local P=g \${P}sed -i '/DIR/c\DIR 38;5;63;1' LS_COLORS @@ -98,70 +98,70 @@ zi light trapd00r/LS_COLORS ### SC: [paoloantinori/hhighlighter](https://github.com/paoloantinori/hhighlighter) {/* #sc-paoloantinorihhighlighter */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid pick"h.sh" zi light paoloantinori/hhighlighter ``` ### SC: [wfxr/forgit](https://github.com/wfxr/forgit) {/* #sc-wfxrforgit */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid zi load wfxr/forgit ``` ### SC: [urbainvaes/fzf-marks](https://github.com/urbainvaes/fzf-marks) {/* #sc-urbainvaesfzf-marks */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid zi load urbainvaes/fzf-marks ``` ### SC: [hlissner/zsh-autopair](https://github.com/hlissner/zsh-autopair) {/* #sc-hlissnerzsh-autopair */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid pick'autopair.zsh' zi load hlissner/zsh-autopair ``` ### SC: [voronkovich/gitignore.plugin.zsh](https://github.com/voronkovich/gitignore.plugin.zsh) {/* #sc-voronkovichgitignorepluginzsh */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid zi load voronkovich/gitignore.plugin.zsh ``` ### SC: [xPMo/zsh-toggle-command-prefix](https://github.com/xPMo/zsh-toggle-command-prefix) {/* #sc-xpmozsh-toggle-command-prefix */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid zi light xPMo/zsh-toggle-command-prefix ``` ### SC: [leonjza/history-here](https://github.com/leonjza/history-here) {/* #sc-leonjzahistory-here */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid zi light leonjza/history-here ``` ### SC: [hkbakke/bash-insulter](https://github.com/hkbakke/bash-insulter) {/* #sc-hkbakkebash-insulter */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid pick'src/bash.command-not-found' zi light hkbakke/bash-insulter ``` ### SC: [leophys/zsh-plugin-fzf-finder](https://github.com/leophys/zsh-plugin-fzf-finder) {/* #sc-leophyszsh-plugin-fzf-finder */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid has'fzf' pick'fzf-finder.plugin.zsh' zi light leophys/zsh-plugin-fzf-finder ``` ### SC: [autosuggestions][1], [fast-syntax-highlighting][2] {/* #sc-autosuggestions1-fast-syntax-highlighting2 */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid atinit"ZI[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" zi light z-shell/F-Sy-H @@ -171,7 +171,7 @@ zi load zsh-users/zsh-autosuggestions ### SC: [z-shell/zsh-github-issues](https://github.com/z-shell/zsh-github-issues) {/* #sc-z-shellzsh-github-issues */} -```shell showLineNumbers +```zsh showLineNumbers zi ice lucid id-as"GitHub-notify" \ on-update-of"~/.cache/zsh-github-issues/new_titles.log" \ notify"New issue: $NOTIFY_MESSAGE" @@ -180,28 +180,28 @@ zi light z-shell/zsh-github-issues ### SC: [zsh-shell/zsh-startify](https://github.com/z-shell/zsh-startify) {/* #sc-zsh-shellzsh-startify */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid atload"zsh-startify" zi load z-shell/zsh-startify ``` ### SC: [z-shell/declare-zsh](https://github.com/z-shell/declare-zsh) {/* #sc-z-shelldeclare-zsh */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid zi load z-shell/declare-zsh ``` ### SC: [z-shell/zsh-navigation-tools](https://github.com/z-shell/zsh-navigation-tools) {/* #sc-z-shellzsh-navigation-tools */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid zi load z-shell/zsh-navigation-tools ``` ### SC: [z-shell/H-S-MW](https://github.com/z-shell/H-S-MW) {/* #sc-z-shellh-s-mw */} -```shell showLineNumbers +```zsh showLineNumbers zstyle ":history-search-multi-word" page-size "11" zi ice wait lucid zi load z-shell/H-S-MW @@ -209,7 +209,7 @@ zi load z-shell/H-S-MW ### SC: [z-shell/zui](https://github.com/z-shell/zui), [z-shell/zi-crasis](https://github.com/z-shell/zi-crasis) {/* #sc-z-shellzui-z-shellzi-crasis */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid zi load z-shell/zui @@ -219,7 +219,7 @@ zi load z-shell/zi-crasis ### SC: [z-shell/zredis](https://github.com/z-shell/zredis) {/* #sc-z-shellzredis */} -```shell showLineNumbers +```zsh showLineNumbers zstyle ":plugin:zredis" configure_opts "--without-tcsetpgrp" zstyle ":plugin:zredis" cflags "-Wall -O2 -g -Wno-unused-but-set-variable" @@ -231,7 +231,7 @@ zi load z-shell/zredis ### SC: [z-shell/zsh-eza](https://github.com/z-shell/zsh-eza) {/* #sc-z-shellzsh-eza */} -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid for \ has'eza' atinit'AUTOCD=1' \ zplugin/zsh-eza @@ -239,21 +239,21 @@ zi wait lucid for \ ### SC: [z-shell/zsh-zoxide](https://github.com/z-shell/zsh-zoxide) {/* #sc-z-shellzsh-zoxide */} -```shell showLineNumbers +```zsh showLineNumbers zi has'zoxide' light-mode for \ z-shell/zsh-zoxide ``` ### GH-R: [pemistahl/grex](https://github.com/pemistahl/grex) {/* #gh-r-pemistahlgrex */} -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid for as"command" from"gh-r" sbin"grex" \ pemistahl/grex ``` ### GH-R: [ahmetb/kubectx](https://github.com/ahmetb/kubectx) {/* #gh-r-ahmetbkubectx */} -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid for as"command" from"gh-r" \ bpick"kubectx;kubens" sbin"kubectx;kubens" \ ahmetb/kubectx @@ -261,7 +261,7 @@ zi wait lucid for as"command" from"gh-r" \ ### B: [stedolan/jq](https://github.com/stedolan/jq) {/* #b-stedolanjq */} -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid for if"(( ! ${+commands[jq]} ))" as"null" \ atclone"autoreconf -fi && ./configure --with-oniguruma=builtin && make \ && ln -sfv $PWD/jq.1 $ZI[MAN_DIR]/man1" sbin"jq" \ @@ -270,7 +270,7 @@ zi wait lucid for if"(( ! ${+commands[jq]} ))" as"null" \ ### GH-R: [github/git-sizer](https://github.com/github/git-sizer) {/* #gh-r-githubgit-sizer */} -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid for \ as"command" from"gh-r" sbin"git-sizer" \ @github/git-sizer diff --git a/community/gallery/collection/07_themes.mdx b/community/gallery/collection/07_themes.mdx index 0c1a98e7a..a90333eb4 100644 --- a/community/gallery/collection/07_themes.mdx +++ b/community/gallery/collection/07_themes.mdx @@ -24,7 +24,7 @@ keywords: Zsh tweak - map colors to the nearest color in the available palette. -```shell +```zsh [[ $COLORTERM = *(24bit|truecolor)* ]] || zmodload zsh/nearcolor ``` @@ -57,7 +57,7 @@ When running: `zi update` will: - if an update is available, will update the fonts. - repeat the install process to update fonts. -```shell +```zsh zi ice if"[[ -d ${HOME}/.fonts/ttf ]] && [[ $OSTYPE = linux* ]]" \ id-as"meslo" from"gh-r" bpick"Meslo.zip" extract nocompile depth"1" \ atclone="rm -f *Windows*; mv -vf *.ttf ${HOME}/.fonts/ttf/; fc-cache -v -f" atpull"%atclone" @@ -66,14 +66,14 @@ zi light ryanoasis/nerd-fonts Load prompt if the terminal has at least 256 colors. -```shell showLineNumbers +```zsh showLineNumbers zi ice if"[ "${TERM##*-}" = '256color' ] || [ "${terminfo[colors]:?}" -gt 255 ]" depth=1 zi light romkatv/powerlevel10k ``` Oneliner: -```shell +```zsh zi ice depth=1; zi light romkatv/powerlevel10k ``` @@ -81,7 +81,7 @@ zi ice depth=1; zi light romkatv/powerlevel10k - Run manually: `p10k configure` (The file `~/.p10k.zsh` auto sourced if exists). -```shell +```zsh zi light-mode for @romkatv ``` @@ -89,21 +89,21 @@ After finishing the configuration wizard last question: - "Apply changes to ~/.zshrc?" choose no - unless you know what you're doing. -```shell showLineNumbers +```zsh showLineNumbers zi ice depth'1' atload"[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh" nocd zi light romkatv/powerlevel10k ``` ### THP: [ohmyzsh/robbyrussell](https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme) {/* #thp-ohmyzshrobbyrussell */} -```shell showLineNumbers +```zsh showLineNumbers zi wait'!' lucid for OMZL::prompt_info_functions.zsh \ OMZT::robbyrussell ``` ### THP: [z-shell/zprompts](https://github.com/z-shell/zprompts) {/* #thp-z-shellzprompts */} -```shell showLineNumbers +```zsh showLineNumbers zi lucid for \ atload"!promptinit; typeset -g PSSHORT=0; \ prompt sprint3 yellow red green blue" nocd \ @@ -112,14 +112,14 @@ zi lucid for \ ### THP: [halfo/lambda-mod-zsh-theme](https://github.com/halfo/lambda-mod-zsh-theme) {/* #thp-halfolambda-mod-zsh-theme */} -```shell showLineNumbers +```zsh showLineNumbers zi lucid for nocd \ halfo/lambda-mod-zsh-theme ``` ### THP: [geometry-zsh/geometry](https://github.com/geometry-zsh/geometry) {/* #thp-geometry-zshgeometry */} -```shell showLineNumbers +```zsh showLineNumbers zi lucid for atload"!geometry::prompt" \ atinit"GEOMETRY_COLOR_DIR=63 GEOMETRY_PATH_COLOR=63" nocd \ geometry-zsh/geometry @@ -127,7 +127,7 @@ zi lucid for atload"!geometry::prompt" \ ### THP: [sindresorhus/pure](https://github.com/sindresorhus/pure) {/* #thp-sindresorhuspure */} -```shell showLineNumbers +```zsh showLineNumbers zi lucid for pick"/dev/null" multisrc"{async,pure}.zsh" \ atload"!prompt_pure_precmd" nocd \ sindresorhus/pure @@ -135,13 +135,13 @@ atload"!prompt_pure_precmd" nocd \ Install as meta-plugin: -```shell +```zsh zi light-mode for @sindresorhus/pure ``` Personalised: -```shell showLineNumbers +```zsh showLineNumbers zi light-mode for compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh' atload" \ PURE_GIT_UP_ARROW='↑'; PURE_GIT_DOWN_ARROW='↓'; PURE_PROMPT_SYMBOL='ᐳ'; PURE_PROMPT_VICMD_SYMBOL='ᐸ'; \ zstyle ':prompt:pure:prompt:success' color 'green' \ @@ -154,7 +154,7 @@ zi light-mode for compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh' atload ### THP: [agkozak/agkozak-zsh-prompt](https://github.com/agkozak/agkozak-zsh-prompt) {/* #thp-agkozakagkozak-zsh-prompt */} -```shell showLineNumbers +```zsh showLineNumbers zi lucid nocd atinit"AGKOZAK_COLORS_PROMPT_CHAR='magenta' AGKOZAK_MULTILINE=0 \ AGKOZAK_PROMPT_CHAR=( ❯ ❯ ❮ ) AGKOZAK_USER_HOST_DISPLAY=0" for \ agkozak/agkozak-zsh-prompt @@ -162,20 +162,20 @@ zi lucid nocd atinit"AGKOZAK_COLORS_PROMPT_CHAR='magenta' AGKOZAK_MULTILINE=0 \ Install as meta-plugin: -```shell +```zsh zi for @agkozak/agkozak-zsh-prompt ``` ### THP: [chauncey-garrett/zsh-prompt-garrett](https://github.com/chauncey-garrett/zsh-prompt-garrett) {/* #thp-chauncey-garrettzsh-prompt-garrett */} -```shell showLineNumbers +```zsh showLineNumbers zi ice atload"fpath+=( \$PWD );" zi light chauncey-garrett/zsh-prompt-garrett ``` ### THP: [starship/starship](https://github.com/starship/starship) {/* #thp-starshipstarship */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as"command" from"gh-r" \ atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \ atpull"%atclone" src"init.zsh" @@ -184,7 +184,7 @@ zi light starship/starship ### THP: [robobenklein/zinc][robobenklein/zinc] {/* #thp-robobenkleinzincrobobenkleinzinc */} -```shell showLineNumbers +```zsh showLineNumbers zi ice wait'!' lucid nocompletions \ compile"{zinc_functions/*,segments/*,zinc.zsh}" \ atload'!prompt_zinc_setup; prompt_zinc_precmd' @@ -193,7 +193,7 @@ zi load robobenklein/zinc ZINC git info is already async, but if you want it even faster with [gitstatus][gitstatus] in turbo mode: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait'1' atload'zinc_optional_dependency_loaded' zi load romkatv/gitstatus ``` diff --git a/docs/getting_started/01_installation.mdx b/docs/getting_started/01_installation.mdx index 0d953aa56..ccee8f46c 100644 --- a/docs/getting_started/01_installation.mdx +++ b/docs/getting_started/01_installation.mdx @@ -45,7 +45,7 @@ sh -c "$(curl -fsSL get.zshell.dev)" -- -a loader The installer will download the loader and add the snippet below to the .zshrc file. -```shell showLineNumbers +```zsh showLineNumbers if [[ -r "${XDG_CONFIG_HOME:-${HOME}/.config}/zi/init.zsh" ]]; then source "${XDG_CONFIG_HOME:-${HOME}/.config}/zi/init.zsh" && zzinit fi @@ -76,7 +76,7 @@ sh -c "$(curl -fsSL get.zshell.dev)" -- -a annex Install and include minimal configuration with recommended annexes and setup zdharma/zunit: -```shell +```zsh sh -c "$(curl -fsSL get.zshell.dev)" -- -a zunit ``` @@ -95,7 +95,7 @@ sh -c "$(curl -fsSL get.zshell.dev)" -- -a zunit Set up the install location and create a directory: -```shell showLineNumbers +```zsh showLineNumbers typeset -Ag ZI typeset -gx ZI[HOME_DIR]="${HOME}/.zi" typeset -gx ZI[BIN_DIR]="${HOME}/.zi/bin" @@ -106,7 +106,7 @@ For security reasons run function compaudit to check if the [completi If failed, then set the current user as the owner of directories, then remove group/others write permissions, and clone the repository: -```shell showLineNumbers +```zsh showLineNumbers compaudit | xargs chown -R "$(whoami)" "$ZI[HOME_DIR]" compaudit | xargs chmod -R go-w "$ZI[HOME_DIR]" command git clone https://github.com/z-shell/zi.git "$ZI[BIN_DIR]" @@ -116,7 +116,7 @@ command git clone https://github.com/z-shell/zi.git "$ZI[BIN_DIR]" To enable Zi, source the zi.zsh from the previously set up directory placing the following snippet in the .zshrc file: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers typeset -A ZI ZI[BIN_DIR]="${HOME}/.zi/bin" source "${ZI[BIN_DIR]}/zi.zsh" @@ -132,7 +132,7 @@ The snippet below must be placed after after enabling Zi. ::: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers autoload -Uz _zi (( ${+_comps} )) && _comps[zi]=_zi ``` diff --git a/docs/getting_started/02_overview.mdx b/docs/getting_started/02_overview.mdx index 01375a2bc..c84eb19e1 100644 --- a/docs/getting_started/02_overview.mdx +++ b/docs/getting_started/02_overview.mdx @@ -22,14 +22,14 @@ This overview will cover the basics for: ## Plugin and snippet loading {/* #plugin-and-snippet-loading */} -```shell showLineNumbers +```zsh showLineNumbers zi load z-shell/H-S-MW zi light zsh-users/zsh-syntax-highlighting ``` The above commands show two ways of basic plugin loading. If you want to source local or remote files (using a direct URL), you can do so with a `snippet`. -```shell +```zsh zi snippet ``` @@ -41,27 +41,27 @@ Using `light` is a faster loading without tracking and reporting about the plugi Using `load` or `light`: -```shell showLineNumbers +```zsh showLineNumbers zi load # Load with reporting/investigating. zi light # Load without reporting/investigating. ``` Plugin history-search-multi-word loaded with investigating: -```shell +```zsh zi load z-shell/H-S-MW ``` Two regular plugins loaded without investigating: -```shell showLineNumbers +```zsh showLineNumbers zi light zsh-users/zsh-autosuggestions zi light z-shell/F-Sy-H ``` Snippet: -```shell +```zsh zi snippet https://gist.githubusercontent.com/hightemp/5071909/raw/ ``` @@ -75,14 +75,14 @@ In turbo mode loading, the slowdown by plugin tracking is done in the background To load Oh-My-Zsh and Prezto plugins, use the `snippet` feature. Snippets are **single files** downloaded by `curl`, `wget`, etc., automatic detection of the download tool is being performed, directly from the URL: -```shell showLineNumbers +```zsh showLineNumbers zi snippet 'https://github.com/robbyrussell/oh-my-zsh/raw/master/plugins/git/git.plugin.zsh' zi snippet 'https://github.com/sorin-ionescu/prezto/blob/master/modules/helper/init.zsh' ``` Also, for Oh-My-Zsh and Prezto, you can use `OMZ::` and `PZT::` shorthands: -```shell showLineNumbers +```zsh showLineNumbers zi snippet OMZ::plugins/git/git.plugin.zsh zi snippet PZT::modules/helper/init.zsh ``` @@ -107,7 +107,7 @@ This way editors like `vim` and `emacs` and also `zsh-users/zsh-syntax-highlight A plugin might not be a file for sourcing, but a command to be added to `$PATH`. To obtain this effect, use ice-modifier `as` with value `program` (or an alias value `command`). -```shell {1} showLineNumbers +```zsh {1} showLineNumbers zi ice as"program" cp"httpstat.sh -> httpstat" pick"httpstat" zi light b4b4r07/httpstat ``` @@ -124,7 +124,7 @@ The `cp` and `mv` ices (and also some other ones, like `atclone`) are being run Copying file is safe for doing later updates – original files of the repository are unmodified and `Git` will report no conflicts. However, `mv` also can be used, if a proper `atpull`, an ice-modifier ran at **update** of the plugin: -```shell showLineNumbers +```zsh showLineNumbers zi ice as"program" mv"httpstat.sh -> httpstat" \ pick"httpstat" atpull'!git reset --hard' zi light b4b4r07/httpstat @@ -148,7 +148,7 @@ Ice modifier defers the loading of a plugin while checking the modification time Copy and paste the example below to the terminal or add it to the `.zshrc` file and reload the shell with `exec zsh`. -```shell {1} showLineNumbers +```zsh {1} showLineNumbers zi ice subscribe'{~/files-*,/tmp/files-*}' id-as'z-sub' lucid \ atload'+zi-message "{profile}I have been loaded{nl}\ {auto}\`Zi Rocks ♥\`"' notify"Yes that is cool ♥ " @@ -167,7 +167,7 @@ The plugin or snippet will be sourced as many times as the file gets updated. Commands can also be added to `$PATH` using **snippets**: -```shell {2} showLineNumbers +```zsh {2} showLineNumbers zi ice mv"httpstat.sh -> httpstat" \ pick"httpstat" as"program" zi snippet https://github.com/b4b4r07/httpstat/blob/master/httpstat.sh @@ -183,7 +183,7 @@ Snippets also support `atpull`. There’s also an `atinit` ice-modifier, execute By using the `as'…'` ice modifier with the value `completion` you can point the `snippet` subcommand directly to a completion file: -```shell {1} showLineNumbers +```zsh {1} showLineNumbers zi ice as"completion" zi snippet https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker ``` @@ -192,7 +192,7 @@ zi snippet https://github.com/docker/cli/blob/master/contrib/completion/zsh/_doc Zi allows disabling and enabling each completion in every plugin. Try installing a popular plugin that provides completions: -```shell {1} showLineNumbers +```zsh {1} showLineNumbers zi ice blockf zi light zsh-users/zsh-completions ``` @@ -203,13 +203,13 @@ To uninstall and install completions: Uninstall: -```shell +```zsh zi cuninstall zsh-users/zsh-completions ``` Install: -```shell +```zsh zi creinstall zsh-users/zsh-completions ``` @@ -217,7 +217,7 @@ zi creinstall zsh-users/zsh-completions To see what completions **all** plugins provide, in tabular formatting and with the name of each plugin: -```shell +```zsh zi clist ``` @@ -235,13 +235,13 @@ Completions can be disabled and other completion will be used, e.g. Zsh builtin. Disable `cmake` completion: -```shell +```zsh zi cdisable cmake ``` Enable `cmake` completion: -```shell +```zsh zi cenable cmake ``` @@ -269,7 +269,7 @@ Zsh 5.3 or greater is required. To use turbo mode add `wait` ice to the target plugin in one of the following ways: -```shell {2} showLineNumbers +```zsh {2} showLineNumbers PS1="READY > " zi ice wait'!0' zi load halfo/lambda-mod-zsh-theme @@ -279,7 +279,7 @@ This sets plugin `halfo/lambda-mod-zsh-theme` to be loaded `0` seconds after `.z You probably won't load the prompt in such a way, however, it is a good example in which turbo mode can be observed. The exclamation mark causes Zi to reset the prompt after loading the plugin – commonly needed for themes. Using `zsh-users/zsh-autosuggestions` without any drawbacks: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid atload'!_zsh_autosuggest_start' zi light zsh-users/zsh-autosuggestions ``` @@ -294,21 +294,21 @@ The `wait` is equivalent to `wait'0'`. ::: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait zi load z-shell/H-S-MW ``` Load after 2 seconds: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait'2' zi load z-shell/H-S-MW ``` Also can be used in `light` and `snippet`: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait zi snippet https://gist.githubusercontent.com/hightemp/5071909/raw/ ``` @@ -317,7 +317,7 @@ zi snippet https://gist.githubusercontent.com/hightemp/5071909/raw/ Turbo and lucid are the most used options because turbo mode is verbose and may require an option for quiet and this can be achieved with the `lucid`. -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid zi load z-shell/H-S-MW ``` @@ -336,7 +336,7 @@ _zsh_autosuggest_start prompt_zinc_setup prompt_zinc_precmd Then, add them to the ice list in the `atload'…'` ice: -```shell {2} showLineNumbers +```zsh {2} showLineNumbers zi ice wait'!' lucid nocd \ atload'!prompt_zinc_setup; prompt_zinc_precmd' zi load robobenklein/zinc @@ -360,7 +360,7 @@ Ices `load` and `unload` allow defining when you want plugins active or inactive Load when in `~/tmp`: -```shell {1} showLineNumbers +```zsh {1} showLineNumbers zi ice load'![[ $PWD = */tmp* ]]' unload'![[ $PWD != */tmp* ]]' \ atload'!promptinit; prompt sprint3' zi load z-shell/zprompts @@ -370,7 +370,7 @@ zi load z-shell/zprompts Load when NOT in `~/tmp`: -```shell {1} showLineNumbers +```zsh {1} showLineNumbers zi ice load'![[ $PWD != */tmp* ]]' unload'![[ $PWD = */tmp* ]]' zi load russjohnson/angry-fly-zsh ``` @@ -399,7 +399,7 @@ This is [powerlevel10k](https://github.com/romkatv/powerlevel10k), [pure](https: Load powerlevel10k theme: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi ice depth"1" zi light romkatv/powerlevel10k ``` @@ -408,7 +408,7 @@ Load pure theme: > will pick the `async.zsh` library and will source it. -```shell {1} title="~/.zshrc" showLineNumbers +```zsh {1} title="~/.zshrc" showLineNumbers zi ice pick"async.zsh" src"pure.zsh" zi light sindresorhus/pure ``` @@ -420,7 +420,7 @@ Load starship theme: > - the `atpull'…'` behavior same as `atclone'…'` and but is used when running `zi update`. > - `src` will source `init.zsh`. -```shell {2} {3} title="~/.zshrc" showLineNumbers +```zsh {2} {3} title="~/.zshrc" showLineNumbers zi ice as"command" from"gh-r" \ atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \ atpull"%atclone" src"init.zsh" @@ -431,14 +431,14 @@ zi light starship/starship Load the pure theme, with the **zsh-async** library that's bundled with it. -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi ice pick"async.zsh" src"pure.zsh" zi light sindresorhus/pure ``` Binary release in the archive, from GitHub. After automatic unpacking, it provides the program "fzf". -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi ice from"gh-r" as"program" zi light junegunn/fzf ``` @@ -447,14 +447,14 @@ One other binary release needs renaming from `docker-compose-Linux-x86_64`. This There are multiple packages per single version for OS X, Linux, and Windows – the ice-modifier `bpick` is utilized to select the Linux package – in this case - not required, Zi will grep operating system name and architecture automatically when there's no `bpick`. -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi ice from"gh-r" as"program" mv"docker* -> docker-compose" bpick"*linux*" zi load docker/compose ``` Handle completions without loading any plugin, see the `clist` command. This one is to be run just once, in an interactive session. -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi creinstall %HOME/my_completions ``` diff --git a/docs/getting_started/03_migration.mdx b/docs/getting_started/03_migration.mdx index df155d69b..a4ba2caa1 100644 --- a/docs/getting_started/03_migration.mdx +++ b/docs/getting_started/03_migration.mdx @@ -15,7 +15,7 @@ import Link from "@docusaurus/Link"; ### OMZ shorthand syntax {/* #omz-shorthand-syntax */} -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi snippet # Raw syntax with URL zi snippet OMZ:: # Shorthand OMZ:: (http://github.com/ohmyzsh/ohmyzsh/raw/master/) zi snippet OMZL:: # Shorthand OMZ::lib (http://github.com/ohmyzsh/ohmyzsh/raw/master/lib) @@ -29,21 +29,21 @@ Importing the [clipboard][omz/clipboard] and [termsupport][omz/termsupport] from Raw syntax: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi snippet https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/clipboard.zsh zi snippet https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/termsupport.zsh ``` OMZ shorthand syntax: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi snippet OMZ::lib/clipboard.zsh zi snippet OMZ::lib/termsupport.zsh ``` OMZL shorthand syntax: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi snippet OMZL::clipboard.zsh zi snippet OMZL::termsupport.zsh ``` @@ -68,7 +68,7 @@ zi snippet OMZL::termsupport.zsh Example of more advanced, conditional turbo loading: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi is-snippet wait lucid for \ atload"unalias grv g" \ OMZP::{git,sudo,encode64,extract} \ @@ -102,7 +102,7 @@ Use `zi ice as"completion"` to directly add single file completion snippets. - [docker][omz/docker] -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi ice as"completion" zi snippet OMZP::docker/completions/_docker ``` @@ -153,7 +153,7 @@ You need to load `prompt_info_functions.zsh` All together it looks like this: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi snippet OMZL::git.zsh zi snippet OMZP::git zi snippet OMZL::theme-and-appearance.zsh @@ -162,7 +162,7 @@ zi snippet OMZL::prompt_info_functions.zsh Then load the prompt: -```shell showLineNumbers +```zsh showLineNumbers setopt prompt_subst zi snippet OMZT::robbyrussell ``` @@ -177,20 +177,20 @@ ZSH_THEME="alpharized" Load `git` library from OMZ: -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi snippet OMZL::git.zsh ``` Load `git` plugin from OMZ: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi snippet OMZP::git zi cdclear -q ``` Then load the prompt: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers setopt prompt_subst zi light NicoSantangelo/Alpharized ``` @@ -199,7 +199,7 @@ zi light NicoSantangelo/Alpharized ### PZT shorthand syntax {/* #pzt-shorthand-syntax */} -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi snippet # Raw syntax with URL zi snippet PZT:: # Shorthand PZT:: (https://github.com/sorin-ionescu/prezto/tree/master/) zi snippet PZTM:: # Shorthand PZT::modules/ (https://github.com/sorin-ionescu/prezto/blob/master/modules/) @@ -211,14 +211,14 @@ Importing the [environment](https://github.com/sorin-ionescu/prezto/blob/master/ Raw syntax -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi snippet https://github.com/sorin-ionescu/prezto/blob/master/modules/environment/init.zsh zi snippet https://github.com/sorin-ionescu/prezto/blob/master/modules/terminal/init.zsh ``` PZT shorthand syntax: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi snippet PZT:: zi snippet PZT::modules/environment zi snippet PZT::modules/terminal @@ -226,7 +226,7 @@ zi snippet PZT::modules/terminal PZTM shorthand syntax: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi snippet PZTM:: zi snippet PZTM::environment zi snippet PZTM::terminal diff --git a/docs/guides/01_commands.mdx b/docs/guides/01_commands.mdx index ab825f2f4..0ca28bc7c 100644 --- a/docs/guides/01_commands.mdx +++ b/docs/guides/01_commands.mdx @@ -24,13 +24,13 @@ The ice-modifiers for any plugin or snippet are stored in their directory in a ` Self-update & compile: -```shell +```zsh zi self-update ``` Update plugins and snippets: -```shell showLineNumbers +```zsh showLineNumbers zi update --all zi update --reset zi update --quiet @@ -38,26 +38,26 @@ zi update --quiet Update plugins or snippets: -```shell showLineNumbers +```zsh showLineNumbers zi update --plugins zi update --snippets ``` Update specific plugins. Default is GitHub but can specify any with ice [from'…'](/search?q=from): -```shell +```zsh zi update / ``` Plugin parallel update plugins: -```shell +```zsh zi update --parallel ``` Increase the number of jobs in a concurrent set to 40 -```shell +```zsh zi update --parallel 40 ``` @@ -75,7 +75,7 @@ With no turbo mode in use, compinit can be called normally, i.e.: as `autoload c As it should be called later, after loading all of the plugins, Zi provides its own `compdef` function that catches (i.e.: records in an array) the arguments of the call, so that the loaded plugins can freely call `compdef`. Then, the `cdreplay` (compdef-replay) can be used, after `compinit` will be called (and the original `compdef` function will become available), to execute all detected `compdef` calls. -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers source ~/.zi/bin/zi.zsh zi load "some/plugin" @@ -113,7 +113,7 @@ There's also `zicdreplay` which will replay any caught compdefs so you can also It is recommended to run the `compinit` call in the `atinit` or `atload` hook of the last related plugin with the use of the helper functions `zicompinit`,`zicdreplay` & `zicdclear` as shown below: -```shell {10} title="~/.zshrc" showLineNumbers +```zsh {10} title="~/.zshrc" showLineNumbers source ~/.zi/bin/zi.zsh # Load using the for-syntax @@ -131,7 +131,7 @@ zi wait lucid atload"zicompinit; zicdreplay" blockf for \ If you want to ignore compdefs provided by some plugins or snippets, place their load commands before commands loading other plugins or snippets, and issue `zi cdclear` (or `zicdclear`, designed to be used in hooks like `atload'…'`): -```shell showLineNumbers +```zsh showLineNumbers source ~/.zi/bin/zi.zsh zi snippet OMZP::git zi cdclear -q # <- forget completions provided by Git plugin diff --git a/docs/guides/02_customization.mdx b/docs/guides/02_customization.mdx index c73510c18..2b8ab5642 100644 --- a/docs/guides/02_customization.mdx +++ b/docs/guides/02_customization.mdx @@ -24,7 +24,7 @@ Set the initial hash definition and custom values, before enabling Zi. Example: -```shell showLineNumbers +```zsh showLineNumbers typeset -A ZI ZI[BIN_DIR]="some/custom/path/to/bin" source "${ZI[BIN_DIR]}/zi.zsh" @@ -88,7 +88,7 @@ Several projects provide git extensions. Installing them with Zi has many benefi Below is a configuration that adds multiple git extensions, loaded in Turbo mode, 1 second after prompt, with the use of the [bin-gem-node][z-shell/z-a-bin-gem-node] annex: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi as'null' wait'1' lucid for \ sbin Fakerr/git-recall \ sbin cloneopts paulirish/git-open \ @@ -126,7 +126,7 @@ Git tools: just run: -```shell +```zsh zi light-mode for z-shell/z-a-meta-plugins @annexes @ext-git ``` @@ -140,7 +140,7 @@ The sense of an option name may be inverted by preceding it with `no`, so `setop {/* TODO: Include more setopt examples and import as component */} -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers setopt append_history # Allow multiple sessions to append to one Zsh command history. setopt extended_history # Show timestamp in history. setopt hist_expire_dups_first # Expire A duplicate event first when trimming history. @@ -157,7 +157,7 @@ setopt share_history # Share history between different instances of the ### Other tweaks {/* #other-tweaks */} -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers setopt auto_cd # Use cd by typing directory name if it's not a command. setopt auto_list # Automatically list choices on ambiguous completion. setopt auto_pushd # Make cd push the old directory onto the directory stack. @@ -180,7 +180,7 @@ The `zstyle` handles the obvious style control for the [completion system][compl {/* TODO: Include more zstyle examples and import as component */} -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zstyle ':completion:*' completer _complete _match _approximate zstyle ':completion:*:match:*' original only zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3>7?7:($#PREFIX+$#SUFFIX)/3))numeric)' @@ -188,7 +188,7 @@ zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX ### Pretty completions {/* #pretty-completions */} -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zstyle ':completion:*:matches' group 'yes' zstyle ':completion:*:options' description 'yes' zstyle ':completion:*:options' auto-description '%d' @@ -208,13 +208,13 @@ zstyle ':completion:*' rehash true ### Do menu-driven completion {/* #do-menu-driven-completion */} -```shell +```zsh zstyle ':completion:*' menu select ``` ### Color completion for [some things][color-completion-using-zsh-modules-on] {/* #color-completion-for-some-things */} -```shell +```zsh zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} ``` diff --git a/docs/guides/03_benchmark.mdx b/docs/guides/03_benchmark.mdx index a61781a72..21b1879f3 100644 --- a/docs/guides/03_benchmark.mdx +++ b/docs/guides/03_benchmark.mdx @@ -22,7 +22,7 @@ Run `zi analytics` to see the available commands for statistics and reporting. ## Profile plugins {/* #i-classfa-solid-fa-gauge-highi-profile-plugins */} -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi ice atinit'zmodload zsh/zprof' \ atload'zprof | head -n 20; zmodload -u zsh/zprof' zi light z-shell/F-Sy-H @@ -70,7 +70,7 @@ The table is sorted in the **self-time** column. Place the snippet below at the top of `.zshrc`. -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers PROFILE_STARTUP=false if [[ "$PROFILE_STARTUP" == true ]]; then @@ -89,7 +89,7 @@ Zsh Sourceforge docs: [Prompt Expansion][prompt-expansion] Place at the bottom of `.zshrc` -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers if [[ "$PROFILE_STARTUP" == true ]]; then unsetopt xtrace exec 2>&3 3>&-; zprof > ~/zshprofile$(date +'%s') diff --git a/docs/guides/syntax/01_standard.mdx b/docs/guides/syntax/01_standard.mdx index 413701046..f5af2aa96 100644 --- a/docs/guides/syntax/01_standard.mdx +++ b/docs/guides/syntax/01_standard.mdx @@ -26,7 +26,7 @@ It is up to the user which syntax to use, but it is highly recommended to famili - Execute the following command in your terminal: -```shell +```zsh zi load z-shell/0 ``` @@ -36,7 +36,7 @@ A snippet is a single file with a portion of reusable source code, machine code, > - Execute the following command in your terminal: -```shell +```zsh zi snippet https://raw.githubusercontent.com/z-shell/zi-src/main/lib/zsh/snippets/welcome.zsh ``` @@ -46,7 +46,7 @@ The top line contains ice-modifiers, and the bottom line is the plugin. > - Execute the following commands in your terminal: -```shell showLineNumbers +```zsh showLineNumbers zi ice id-as'zsh/plugin' atinit'print "Hello World!"' zi load z-shell/0 ``` @@ -57,7 +57,7 @@ Let's install again with more ice-modifiers. > - Execute the following commands in your terminal: -```shell showLineNumbers +```zsh showLineNumbers zi ice id-as'final/countdown' \ atinit'+zi-message "{bapo}Cloned!"' \ atclone'+zi-message "{quos}Boom!"' \ @@ -95,21 +95,21 @@ The order of execution of related ice-modifiers is as follows: Zi supports alternatives such as the equal (`=`) syntax: -```shell showLineNumbers +```zsh showLineNumbers zi ice id-as=equal atload="print Hello World" zi load z-shell/0 ``` The colon (`:`) syntax: -```shell showLineNumbers +```zsh showLineNumbers zi ice id-as:colon atload:"print Hello World" zi load z-shell/0 ``` And also – in conjunction with all of the above – the GNU syntax: -```shell showLineNumbers +```zsh showLineNumbers zi ice id-as=GNU --atload="print Hello World" zi load z-shell/0 ``` @@ -120,7 +120,7 @@ The syntax alternatives can utilize the highlighting of editors like Vim – and Vim repository on GitHub – a typical source code that needs compilation, Zi can manage the run of `./configure` and other `make` stuff. Ice-modifier `pick` adds the binary program to `$PATH`. You could also install the package under the path $ZPFX. -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi ice as"program" atclone"rm -f src/auto/config.cache; ./configure" \ atpull"%atclone" make pick"src/vim" zi light vim/vim @@ -134,7 +134,7 @@ The `make'…'` ice could also be: `make"install PREFIX=$ZPFX"`, if "install" wo ::: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi ice as"program" pick"$ZPFX/bin/git-*" make"PREFIX=$ZPFX" zi light tj/git-extras ``` @@ -151,7 +151,7 @@ The `Makefile` with 2 tasks, can use: ### Compiling programs {/* #compiling-programs */} -```shell showLineNumbers +```zsh showLineNumbers zi ice as"program" atclone"rm -f src/auto/config.cache; ./configure" \ atpull"%atclone" make pick"src/vim" zi light vim/vim @@ -175,7 +175,7 @@ zi light vim/vim The same but with **installation** (`make install`) under [$ZPFX][global-parameter-with-prefix] by default: -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' atclone'rm -f src/auto/config.cache; \ ./configure --prefix=$ZPFX' atpull'%atclone' make'all install' pick'$ZPFX/bin/vim' zi light vim/vim @@ -201,7 +201,7 @@ zi light vim/vim A repository [trapd00r/LS_COLORS][trapd00r-ls_colors] provides a file with color definitions for GNU `ls` command, and also for [ogham/exa][ogham-exa]. Typically one does `eval $( dircolors -b $HOME/LS_COLORS)` to process this file and set the environment for `ls`. This means `dircolors` is run by every shell startup. It costs much time to create a fork and program, i.e., the `dircolors` binary needs to be loaded to obtain and process the color definitions. The following invocation solves this problem: -```shell showLineNumbers +```zsh showLineNumbers zi ice atclone'dircolors -b LS_COLORS > clrs.zsh' \ atpull'%atclone' pick"clrs.zsh" nocompile'!' \ atload'zstyle ":completion:*" list-colors ${(s.:.)LS_COLORS}' @@ -230,7 +230,7 @@ This way, except for the plugin installation and update, `dircolors` isn't run, The project [direnv/direnv][direnv-direnv] registers itself in the Z shell to modify the environment on directory change. This registration is most often done by `eval "$(direnv hook zsh)"` added to `.zshrc`. -```shell showLineNumbers +```zsh showLineNumbers zi ice as"program" make'!' atclone'./direnv hook zsh > zhook.zsh' \ atpull'%atclone' src"zhook.zsh" zi light direnv/direnv @@ -247,7 +247,7 @@ Above `atclone'…'` puts this code into file `zhook.zsh`, `src''` sources it. T The drawback of this standard procedure is that the `direnv` binary is run on every shell startup and significantly slows it down. Zi allows to solve this in the following way: -```shell showLineNumbers +```zsh showLineNumbers zi as"program" make'!' atclone'./direnv hook zsh > zhook.zsh' \ atpull'%atclone' pick"direnv" src"zhook.zsh" for \ direnv/direnv @@ -272,7 +272,7 @@ zi as"program" make'!' atclone'./direnv hook zsh > zhook.zsh' \ In this method, the registered code is generated once on every installation or update, then sourced without running `direnv` itself. The project is also available as a binary [GitHub releases][gh-releases]. This distribution can be installed by: -```shell showLineNumbers +```zsh showLineNumbers zi from"gh-r" as"program" mv"direnv* -> direnv" \ atclone'./direnv hook zsh > zhook.zsh' atpull'%atclone' \ pick"direnv" src="zhook.zsh" for \ @@ -350,7 +350,7 @@ Zip, rar, tar.gz, tar.bz2, tar.xz, tar.7z, tar, tgz, tbz2, gz, bz2, txz, xz, 7z, To install and load a plugin whose repository is private - e.g: requires providing credentials to log in – use the `from'…'` ice in the following way: -```shell showLineNumbers +```zsh showLineNumbers zi ice from"user@github.com" zi load user/fsh-auto-themes ``` @@ -397,7 +397,7 @@ In order to change the protocol, use the `proto'…'` ice. Load a plugin or snippet with a nickname with the `id-as'…'` ice-modifier. For example, one could try to load [docker/compose][docker-compose] from GitHub binary releases: -```shell showLineNumbers +```zsh showLineNumbers zi ice as"program" from"gh-r" mv"docker-c* -> docker-compose" zi light "docker/compose" ``` @@ -406,21 +406,21 @@ This registers the plugin under the ID `docker/compose`. Now suppose the user wo The solution to this problem – the `id-as'…'` (to be read as _identify-as_) ice to which this document is devoted: by using the `id-as'…'` ice the user can resolve the conflict by loading the completion under a kind of a _nickname_, for example under "_dc-complete_", by issuing the following commands: -```shell showLineNumbers +```zsh showLineNumbers zi ice as"completion" id-as"dc-complete" zi load docker/compose ``` The plugin (of the type `completion`) is now seen under ID `dc-complete`: -```shell showLineNumbers +```zsh showLineNumbers zi list | grep -i dc-complete dc-complete ``` Issuing `zi report dc-complete` will work as with regular command: -```shell showLineNumbers +```zsh showLineNumbers zi report dc-complete Plugin report for dc-complete @@ -432,7 +432,7 @@ _docker-compose [enabled] The same method applies to nickname snippets. For instance, use it to create handy IDs in place of long URLs: -```shell showLineNumbers +```zsh showLineNumbers zi ice as"program" id-as"git-unique" zi snippet https://github.com/Osse/git-scripts/blob/master/git-unique ``` @@ -443,14 +443,14 @@ The commands `zi update git-unique`, and `zi delete git-unique` will work as exp There's a special value to the `id-as'…'` ice – `auto`. It causes the nickname to be automatically set to the last component of the plugin name or snippet URL. For example: -```shell showLineNumbers +```zsh showLineNumbers zi ice as"program" id-as"auto" zi snippet https://github.com/Osse/git-scripts/blob/master/git-unique ``` will work the same as before, e.g: if the ice used was `id-as'git-unique'`. Will work as if id-as'zsh-autopair' was passed: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid id-as"auto" zi load hlissner/zsh-autopair ``` @@ -459,7 +459,7 @@ zi load hlissner/zsh-autopair An empty `id-as'…'` will work the same as `id-as'auto'` as if id-as'zsh-autopair' was passed, e.g: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait lucid id-as zi load hlissner/zsh-autopair ``` @@ -472,7 +472,7 @@ Turbo mode, i.e. the `wait'…'` is ice that implements it - needs Zsh >= 5.3. ::: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait'0' # or just: zi ice wait zi light wfxr/forgit ``` @@ -480,7 +480,7 @@ zi light wfxr/forgit - waits for prompt, - instantly ("0" seconds) after prompt loads given plugin. -```shell showLineNumbers +```zsh showLineNumbers zi ice wait'[[ -n ${ZLAST_COMMANDS[(r)cras*]} ]]' zi light z-shell/zi-crasis ``` @@ -494,14 +494,14 @@ zi light z-shell/zi-crasis - `-n` means: not-empty, so it will be true when users enter "cras", - after 1 second or less, Zi will detect that the `wait'…'` condition is true, and load the plugin, which provides command _crasis_, -```shell showLineNumbers +```zsh showLineNumbers zi ice wait'[[ $PWD = */github || $PWD = */github/* ]]' zi load unixorn/git-extra-commands ``` it waits until the user enters a `github` directory. Turbo mode also supports a suffix – the letter a, `b`, or `c`. The meaning is illustrated by the following example: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait"0b" as"command" pick"wd.sh" atinit"echo Firing 1" lucid zi light mfaerevaag/wd zi ice wait"0a" as"command" pick"wd.sh" atinit"echo Firing 2" lucid @@ -523,7 +523,7 @@ In other words, instead of `wait'1'`, you can enter `wait'1a'`, `wait'1b'`, and Normally `src'…'` can be used to specify the additional file to the source: -```shell showLineNumbers +```zsh showLineNumbers zi ice pick'powerless.zsh' src'utilities.zsh' zi light martinrotter/powerless ``` @@ -537,7 +537,7 @@ zi light martinrotter/powerless Loads **multiple** files enumerated with spaces as the separator (e.g. `multisrc'misc.zsh grep.zsh'`) and also using brace-expansion syntax (e.g. `multisrc'{misc,grep}.zsh')`. Example: -```shell showLineNumbers +```zsh showLineNumbers zi ice pick'completion.zsh' \ multisrc'git.zsh functions.zsh {history,grep}.zsh' zi snippet OMZ::lib/completion.zsh @@ -545,19 +545,19 @@ zi snippet OMZ::lib/completion.zsh All possible ways to use the `multisrc'…'` ice-modifier: -```shell +```zsh zi ice depth'1' multisrc='lib/{functions,misc}.zsh' pick'/dev/null' zi load robbyrussell/oh-my-zsh ``` Can use patterns: -```shell showLineNumbers +```zsh showLineNumbers zi ice multisrc'{funct*,misc}.zsh' pick'/dev/null' zi light some/plugin ``` -```shell showLineNumbers +```zsh showLineNumbers zi ice multisrc'misc.zsh functions.zsh' pick'/dev/null' zi light some/plugin ``` @@ -566,7 +566,7 @@ Will use the array's value at the moment of plugin load: > This can matter when using turbo mode. -```shell showLineNumbers +```zsh showLineNumbers array=({functions,misc}.zsh) zi ice multisrc"\$array" pick'/dev/null' zi light some/plugin @@ -574,7 +574,7 @@ zi light some/plugin Compatible with KSH_ARRAYS option: -```shell showLineNumbers +```zsh showLineNumbers array=({functions,misc}.zsh) zi ice multisrc"${array[*]}" pick'/dev/null' zi light some/plugin @@ -584,7 +584,7 @@ Hack with Zi: the ice's contents are simply `eval`-uated like follows: eval "rep So it might get handy on an occasion to pass code there, but first, you must close the paren and then don't forget to assign `reply`, and to provide a trailing opening paren. In the code be careful to not redefine any variable used internally by Zi – e.g.: `i` is safe: -```shell showLineNumbers +```zsh showLineNumbers array=({functions,misc}.zsh) zi ice multisrc'); local i; for i in $array; do reply+=( ${i/.zsh/.sh} ); done; ((1)' pick'/dev/null' zi light some/plugin @@ -594,14 +594,14 @@ Extended with the [for][for-syntax] syntax which can in some situations replace Instead of: -```shell showLineNumbers +```zsh showLineNumbers zi ice multisrc'(functions|misc|completion).zsh' zi snippet OMZ::lib/completion.zsh ``` it's possible to write: -```shell showLineNumbers +```zsh showLineNumbers zi for \ OMZL::functions.zsh \ OMZL::misc.zsh \ @@ -647,14 +647,14 @@ However, if the function is being called from the `atload'…'` ice, then the _e For example, in the following invocation: -```shell showLineNumbers +```zsh showLineNumbers zi ice id-as'test' atload'!PATH+=:~/share' zi load z-shell/null ``` the `$PATH` is being changed within `atload'…'` ice. Zi's tracking registers `$PATH` changes and withdraws them on the plugin unload and shows loading information: -```shell title="zi report test" showLineNumbers +```zsh title="zi report test" showLineNumbers Report for test plugin ---------------------- Source (reporting enabled) @@ -665,7 +665,7 @@ PATH elements added: As it can be seen, the `atload'…'` code is being correctly tracked and can be unloaded & viewed. Below is the result of using the `unload'…'` subcommand to unload the `test` plugin: -```shell title="zi unload test" showLineNumbers +```zsh title="zi unload test" showLineNumbers --- Unloading plugin: test --- Removing PATH element /home/user/share Unregistering plugin test @@ -676,7 +676,7 @@ The same example as in the [wrap'…'](#use-case-for-wrap) article, but using th Load when - `MYPROMPT == 4` -```shell showLineNumbers +```zsh showLineNumbers zi ice load'![[ $MYPROMPT = 4 ]]' unload'![[ $MYPROMPT != 4 ]]' \ atload'!source ~/.p10k.zsh; _p9k_precmd' zi load romkatv/powerlevel10k @@ -688,7 +688,7 @@ The `wrap' …'` ice-modifier allows extending the tracking (e.g.: the gathering For example, [romkatv/powerlevel10k][romkatv-powerlevel10k] works this way. The ice takes a list of function names, with the elements separated by `;`: -```shell +```zsh zi ice wrap"func1;func2;…" ``` @@ -698,7 +698,7 @@ Therefore, to load and unload for the example powerlevel10k prompt in the fashio Load when `MYPROMPT == 4` -```shell showLineNumbers +```zsh showLineNumbers zi ice load'![[ $MYPROMPT = 4 ]]' unload'![[ $MYPROMPT != 4 ]]' \ atload'source ~/.p10k.zsh; _p9k_precmd' wrap'_p9k_precmd' zi load romkatv/powerlevel10k @@ -706,7 +706,7 @@ zi load romkatv/powerlevel10k This way the actions done during the first call to `_p9k_precmd()` will be normally recorded, which can be viewed in the report of the [romkatv/powerlevel10k][romkatv-powerlevel10k] theme: -```shell title="zi report romkatv/powerlevel10k" showLineNumbers +```zsh title="zi report romkatv/powerlevel10k" showLineNumbers Report for romkatv/powerlevel10k plugin --------------------------------------- Source powerlevel10k.zsh-theme (reporting enabled) diff --git a/docs/guides/syntax/02_for.mdx b/docs/guides/syntax/02_for.mdx index d74656016..76e563bea 100644 --- a/docs/guides/syntax/02_for.mdx +++ b/docs/guides/syntax/02_for.mdx @@ -23,7 +23,7 @@ To find more information about anything use [search][3] or just CTRL+K exa" sbin ogham/exa \ mv"fd* -> fd" sbin"fd/fd" @sharkdp/fd \ @@ -64,7 +64,7 @@ zi for as"null" wait"2" lucid from"gh-r" \ [Turbo][6] load some plugins, without any plugin-specific ices: -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid for \ hlissner/zsh-autopair \ urbainvaes/fzf-marks @@ -72,7 +72,7 @@ zi wait lucid for \ Load two [Oh-My-Zsh][7] files as [snippets][8], in turbo mode: -```shell showLineNumbers +```zsh showLineNumbers zi wait lucid for \ OMZ::lib/git.zsh \ atload"unalias grv" \ @@ -81,7 +81,7 @@ zi wait lucid for \ Popular plugin set with [turbo][6] and The "For": -```shell {1} showLineNumbers +```zsh {1} showLineNumbers zi wait lucid light-mode for \ atinit"zicompinit; zicdreplay" \ z-shell/F-Sy-H \ @@ -114,7 +114,7 @@ zi wait lucid light-mode for \ ### Without [turbo mode][6] and The "For" {/* #i-classfa-solid-fa-forward-stepi-without-turbo-mode6-and-the-for */} -```shell showLineNumbers +```zsh showLineNumbers # A. setopt prompt_subst @@ -142,7 +142,7 @@ zi light z-shell/F-Sy-H ### With [turbo mode][6] and The "For" {/* #i-classfa-solid-fa-forward-fasti-with-turbo-mode6-and-the-for */} -```shell showLineNumbers +```zsh showLineNumbers # A. setopt prompt_subst @@ -193,7 +193,7 @@ Try both setups on the daily basis to notice the difference. The features of Zi The `zi-turbo` is a function to simplify `wait`: -```shell showLineNumbers +```zsh showLineNumbers zi-turbo() { zi depth'3' lucid ${1/#[0-9][a-c]/wait"${1}"} "${@:2}" } @@ -201,7 +201,7 @@ zi-turbo() { Then use the `for` syntax in the imposed loading order: -```shell {1,6,10,15} showLineNumbers +```zsh {1,6,10,15} showLineNumbers zi-turbo '0a' for \ OMZL::git.zsh \ OMZL::compfix.zsh \ diff --git a/docs/guides/syntax/10_bindkey.mdx b/docs/guides/syntax/10_bindkey.mdx index 6ca84d647..89788b48a 100644 --- a/docs/guides/syntax/10_bindkey.mdx +++ b/docs/guides/syntax/10_bindkey.mdx @@ -42,7 +42,7 @@ Zi provides a solution to this problem – the ability to remap the bindkeys wit Map Ctrl-G instead of Ctrl-R for the history searcher. -```shell +```zsh zi bindmap'^R -> ^G' for z-shell/history-search-multi-word ``` @@ -54,7 +54,7 @@ Could also separate the bindmaps with a semicolon, i.e.: bindmap'"\\e[1\;6D" -> \\e[1\;5D ; "\\e[1\;6C" -> ^[[1\;5C' \ ``` -```shell showLineNumbers +```zsh showLineNumbers zi wait light-mode trackbinds bindmap'"\\e[1\;6D" -> \\e[1\;5D"' \ bindmap'"\\e[1\;6C" -> ^[[1\;5C' pick'dircycle.zsh' for \ michaelxmcbride/zsh-dircycle @@ -62,7 +62,7 @@ zi wait light-mode trackbinds bindmap'"\\e[1\;6D" -> \\e[1\;5D"' \ Map space to regular space and Ctrl-Space to the `globalias` widget, which expands the alias entered on the left, provided by OMZ globalias plugin. -```shell showLineNumbers +```zsh showLineNumbers zi bindmap='!" " -> magic-space; !"^ " -> globalias' nocompletions \ depth=1 pick=plugins/globalias/globalias.plugin.zsh for \ ohmyzsh/ohmyzsh @@ -78,14 +78,14 @@ In this mode, the given key is being mapped to the given widget instead of the w Instead of: -```shell showLineNumbers +```zsh showLineNumbers bindkey "^ " magic-space bindkey " " globalias ``` The actual call that'll be done will be: -```shell showLineNumbers +```zsh showLineNumbers bindkey "^ " globalias bindkey " " magic-space ``` @@ -104,14 +104,14 @@ In the non-investigation: With the use of the light-mode ice and the for-syntax: -```shell showLineNumbers +```zsh showLineNumbers zi light-mode for trackbinds bindmap'^R -> ^G' \ z-shell/history-search-multi-word ``` With the use of the traditional syntax: -```shell showLineNumbers +```zsh showLineNumbers zi ice trackbinds bindmap'^R -> ^G' zi light z-shell/history-search-multi-word ``` @@ -120,7 +120,7 @@ zi light z-shell/history-search-multi-word There are four special values that can be used on the left side of the bind-map: UPAR, DOWNAR, LEFTAR, RIGHTAR. They'll match up arrow, down arrow, etc. So that it's possible to do: -```shell +```zsh zi bindmap='LEFTAR -> ^F; RIGHTAR -> ^G' … ``` diff --git a/ecosystem/annexes/0_overview.mdx b/ecosystem/annexes/0_overview.mdx index 0ccff5f3d..e6ae68405 100644 --- a/ecosystem/annexes/0_overview.mdx +++ b/ecosystem/annexes/0_overview.mdx @@ -46,13 +46,13 @@ keywords: Use [meta-plugins](/ecosystem/annexes/meta-plugins) to install common annexes as a group: -```shell +```zsh zi light-mode for z-shell/z-a-meta-plugins @annexes ``` To install common and additional annexes: -```shell +```zsh zi light-mode for z-shell/z-a-meta-plugins @annexes+rec ``` @@ -105,7 +105,7 @@ The recommended method of creating a hook is to place its body into a file that `@zi-register-annex`: -```shell showLineNumbers +```zsh showLineNumbers @zi-register-annex myproject hook:atclone \ →za-myproject-atclone-handler \ →za-myproject-atclone-help-handler \ @@ -114,7 +114,7 @@ The recommended method of creating a hook is to place its body into a file that The general syntax of the API call is: -```shell showLineNumbers +```zsh showLineNumbers @zi-register-annex {project-name} \ {hook: \ {name-of-the-handler-function} \ @@ -126,7 +126,7 @@ The last argument, i.e. the `|`-separated ice list, is optional. That’s all\! Example of the [submods][submods] ice-modifier to load a plugin with additional submodules: -```shell showLineNumbers +```zsh showLineNumbers zi ice submods'zsh-users/zsh-autosuggestions -> external' zi load some/plugin ``` diff --git a/ecosystem/annexes/19_eval.mdx b/ecosystem/annexes/19_eval.mdx index 52316bc56..dbbe1f6b8 100644 --- a/ecosystem/annexes/19_eval.mdx +++ b/ecosystem/annexes/19_eval.mdx @@ -33,14 +33,14 @@ The optional preceding `!` flag means to store command output regardless of exit -```shell showLineNumbers +```zsh showLineNumbers zi ice as"command" from"gh-r" \ atclone"./zoxide init --cmd x zsh > init.zsh" \ atpull"%atclone" src"init.zsh" nocompile'!' zi light ajeetdsouza/zoxide ``` -```shell showLineNumbers +```zsh showLineNumbers zi ice atclone"dircolors -b LS_COLORS > init.zsh" \ atpull"%atclone" pick"init.zsh" nocompile'!' \ atload'zstyle ":completion:*" list-colors ${(s.:.)LS_COLORS}' @@ -50,13 +50,13 @@ zi light trapd00r/LS_COLORS -```shell {2} showLineNumbers +```zsh {2} showLineNumbers zi ice as"command" from"gh-r" \ eval"./zoxide init --cmd x zsh" zi light ajeetdsouza/zoxide ``` -```shell {1} showLineNumbers +```zsh {1} showLineNumbers zi ice eval"dircolors -b LS_COLORS" \ atload'zstyle ":completion:*" list-colors ${(s.:.)LS_COLORS}' zi light trapd00r/LS_COLORS @@ -76,7 +76,7 @@ fi -```shell {2} showLineNumbers +```zsh {2} showLineNumbers zi ice id-as"kubectl_completion" has"kubectl" \ eval"kubectl completion zsh" run-atpull zi light z-shell/null @@ -100,7 +100,7 @@ zi light z-shell/null Add the following snippet in the `.zshrc` file: -```shell +```zsh zi light z-shell/z-a-eval ``` @@ -111,7 +111,7 @@ Add the following snippet in the `.zshrc` file: > Set value `Z_A_USECOMP=1` to enable TAB completion for subcommand `recache`. -```shell showLineNumbers +```zsh showLineNumbers zi ice atinit'Z_A_USECOMP=1' zi light z-shell/z-a-eval ``` diff --git a/ecosystem/annexes/1_bin_gem_node.mdx b/ecosystem/annexes/1_bin_gem_node.mdx index d710477cd..8c40b3db2 100644 --- a/ecosystem/annexes/1_bin_gem_node.mdx +++ b/ecosystem/annexes/1_bin_gem_node.mdx @@ -34,27 +34,27 @@ As previously mentioned, the function can automatically export `$GEM_HOME`, `$NO Suppose that we want to install the `junegunn/fzf` plugin from GitHub Releases, which contains only a single file – the `fzf` binary for the selected architecture. It is possible to do it in the standard way – by adding the plugin's directory to the `$PATH`. -```shell +```zsh zi ice as'program' from'gh-r' zi load junegunn/fzf ``` After this command, the `$PATH` variable will contain e.g.: -```shell title="print $PATH" showLineNumbers +```zsh title="print $PATH" showLineNumbers /home/sall/.zi/plugins/junegunn---fzf:/bin:/usr/bin:/usr/sbin:/sbin ``` For many such programs loaded as plugins, the PATH can become quite cluttered. I've had 26 entries before switching to `z-a-bin-gem-node`. To solve this, load with the use of [sbin](#sbin-1) ice-modifier provided and handled by `z-a-bin-gem-node`: -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' from'gh-r' sbin'fzf' zi load junegunn/fzf ``` The `$PATH` will remain unchanged and a forwarder-script of `fzf` shim will be created in `$ZPFX/bin` (`~/.zi/polaris/bin` by default), which is being already added to the `$PATH` by Zi when it is being sourced: -```shell title="cat $ZPFX/bin/fzf" showLineNumbers +```zsh title="cat $ZPFX/bin/fzf" showLineNumbers #!/usr/bin/env zsh function fzf { @@ -128,12 +128,12 @@ Creates the so-called `shim` known from `rbenv` – a wrapper script that forwar fit={false} /> -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' from'gh-r' sbin'fzf' zi load junegunn/fzf ``` -```shell title="cat $ZPFX/bin/fzf" showLineNumbers +```zsh title="cat $ZPFX/bin/fzf" showLineNumbers #!/usr/bin/env zsh function fzf { @@ -175,12 +175,12 @@ Creates a wrapper function of the name the same as the last segment of the path fit={false} /> -```shell showLineNumbers +```zsh showLineNumbers zi ice from"gh-r" fbin"g:fzf -> myfzf" nocompile zi load junegunn/fzf ``` -```shell title="which myfzf" showLineNumbers +```zsh title="which myfzf" showLineNumbers myfzf () { local bindir="/home/sall/.zi/plugins/junegunn---fzf" local -x GEM_HOME="/home/sall/.zi/plugins/junegunn---fzf" @@ -213,12 +213,12 @@ Installs the gem of name `{gem-name}` with `$GEM_HOME` set to the plugin's or sn fit={false} /> -```shell showLineNumbers +```zsh showLineNumbers zi ice gem'!asciidoctor' id-as'asciidoctor' nocompile zi load z-shell/0 ``` -```shell title="which asciidoctor" showLineNumbers +```zsh title="which asciidoctor" showLineNumbers asciidoctor () { local bindir="/home/sall/.zi/plugins/asciidoctor/bin" local -x GEM_HOME="/home/sall/.zi/plugins/asciidoctor" @@ -253,12 +253,12 @@ Installs the node module of name `{node-module}` inside the plugin's or snippet' fit={false} /> -```shell showLineNumbers +```zsh showLineNumbers zi ice node'remark <- !remark-cli -> remark; remark-man' id-as'remark' nocompile zi load z-shell/0 ``` -```shell title="which remark" showLineNumbers +```zsh title="which remark" showLineNumbers remark () { local bindir="/home/sall/.zi/plugins/remark/node_modules/.bin" local -x NODE_PATH="/home/sall/.zi/plugins/remark"/node_modules @@ -295,12 +295,12 @@ Installs the node module of name `{pip-package}` inside the plugin's or snippet' fit={false} /> -```shell showLineNumbers +```zsh showLineNumbers zi ice pip'youtube-dl <- !youtube-dl -> youtube-dl' id-as'youtube-dl' nocompile zi load z-shell/0 ``` -```shell title="which youtube-dl" showLineNumbers +```zsh title="which youtube-dl" showLineNumbers youtube-dl () { local bindir="/home/sall/.zi/plugins/youtube-dl/venv/bin" local -x VIRTUALENV="/home/sall/.zi/plugins/youtube-dl"/venv @@ -337,12 +337,12 @@ Example: fit={false} /> -```shell showLineNumbers +```zsh showLineNumbers myfunc() { pwd; ls -1 }; zi ice fmod'cgn:myfunc' id-as'myfunc' nocompile zi load z-shell/0 ``` -```shell title="which myfunc" showLineNumbers +```zsh title="which myfunc" showLineNumbers myfunc () { local -x GEM_HOME="/home/sall/.zi/plugins/myfunc" local -x NODE_PATH="/home/sall/.zi/plugins/myfunc"/node_modules @@ -359,7 +359,7 @@ myfunc () { } ``` -```shell title="myfun" showLineNumbers +```zsh title="myfun" showLineNumbers /home/sall/.zi/plugins/z-shell---0 docs/ LICENSE @@ -397,12 +397,12 @@ Creates a wrapper function that at each invocation sources the given file. The s fit={false} /> -```shell showLineNumbers +```zsh showLineNumbers zi ice fsrc"myscript -> myfunc" ferc"myscript" nocompile zi load z-shell/0 ``` -```shell title="which myfunc" showLineNumbers +```zsh title="which myfunc" showLineNumbers myfunc () { local bindir="/home/sall/.zi/plugins/z-shell---0" local -xU PATH="$bindir":"$PATH" @@ -412,7 +412,7 @@ myfunc () { } ``` -```shell title="which myscript" showLineNumbers +```zsh title="which myscript" showLineNumbers myscript () { local bindir="/home/sall/.zi/plugins/z-shell---0" local -xU PATH="$bindir":"$PATH" @@ -436,7 +436,7 @@ An annex provides a subcommand – `shim-list` for shims currently stored in `$Z Available flags are: -```shell +```zsh zi shim-list [ -t | -i | -o | -s | -h ] ``` @@ -452,7 +452,7 @@ zi shim-list [ -t | -i | -o | -s | -h ] The [sbin](#sbin-1) ice-modifier has an explicit Cygwin support – it creates additional, **extra shim files** – Windows batch scripts that allow running the shielded applications from e.g.: Windows run dialog – if the `~/.zi/polaris/bin` directory is being added to the Windows `PATH` environment variable, for example (it is a good idea to do so, IMHO). The Windows shims have the same name as the standard ones (which are also being created, normally) plus the `.cmd` extension. You can test the feature by e.g.: installing Firefox from the Zi package via: -```shell +```zsh zi pack=bgn for firefox ``` @@ -471,7 +471,7 @@ zi pack=bgn for firefox Add the following snippet in the `.zshrc` file: -```shell +```zsh zi light z-shell/z-a-bin-gem-node ``` @@ -480,7 +480,7 @@ zi light z-shell/z-a-bin-gem-node Add the following snippet in the `.zshrc` file to install using the [unscope][] annex: -```shell +```zsh zi light z-shell/z-a-unscope bgn ``` diff --git a/ecosystem/annexes/20_test.mdx b/ecosystem/annexes/20_test.mdx index 11d6afc27..af502e6ba 100644 --- a/ecosystem/annexes/20_test.mdx +++ b/ecosystem/annexes/20_test.mdx @@ -33,7 +33,7 @@ An annex runs `zunit` and `make` tests if they are configured in the repository. Simply load it like any other plugin to make it active: -```shell +```zsh zi light z-shell/z-a-test ``` @@ -42,13 +42,13 @@ zi light z-shell/z-a-test To run the tests in a verbose mode, issue: -```shell +```zsh zstyle :zi:annex:test quiet 0 ``` To skip tests for a single plugin before installing or updating add the `notest` ice-modifier: -```shell showLineNumbers +```zsh showLineNumbers zi ice notest zi load … ``` diff --git a/ecosystem/annexes/2_meta_plugins.mdx b/ecosystem/annexes/2_meta_plugins.mdx index 8fd726dab..5b5529adc 100644 --- a/ecosystem/annexes/2_meta_plugins.mdx +++ b/ecosystem/annexes/2_meta_plugins.mdx @@ -28,20 +28,20 @@ An annex has the curated, optimal [ice-modifiers][] lists automatically applied. The following snippets are examples of how to install meta-plugins: -```shell +```zsh zi light @annexes ``` -```shell +```zsh zi light-mode for @annexes @zsh-users @console-tools ``` -```shell showLineNumbers +```zsh showLineNumbers zi light-mode for z-a-meta-plugins \ @annexes @ext-git @zsh-users ``` -```shell showLineNumbers +```zsh showLineNumbers zi light-mode for @annexes \ skip'zsh-completions' @zsh-users \ skip'vivid exa tig' @console-tools @@ -130,7 +130,7 @@ Other unique benefits of the meta-plugins annex: Add the following snippet in the `.zshrc` file: -```shell +```zsh zi light z-shell/z-a-meta-plugins ``` diff --git a/ecosystem/annexes/3_default_ice.mdx b/ecosystem/annexes/3_default_ice.mdx index f1a019828..154350937 100644 --- a/ecosystem/annexes/3_default_ice.mdx +++ b/ecosystem/annexes/3_default_ice.mdx @@ -17,13 +17,13 @@ An annex delivers the capability to set **default ices** for the next `zi` comma set default-ices: -```shell +```zsh zi default-ice lucid from"gh-r" ``` this will download from GitHub releases (gh-r) and also use the lucid ice by default: -```shell showLineNumbers +```zsh showLineNumbers zi wait for \ sbin junegunn/fzf-bin \ sbin"**/pk" peco/peco @@ -65,7 +65,7 @@ An annex provides a subcommand – `default-ice` which has the following synopsi Add the following snippet in the `.zshrc` file: -```shell +```zsh zi light z-shell/z-a-default-ice ``` diff --git a/ecosystem/annexes/4_patch-dl.mdx b/ecosystem/annexes/4_patch-dl.mdx index b361d4377..806cc2d7f 100644 --- a/ecosystem/annexes/4_patch-dl.mdx +++ b/ecosystem/annexes/4_patch-dl.mdx @@ -18,13 +18,13 @@ An annex downloads files and applies patches and adds two ice-modifiers: first: -```shell +```zsh zi ice dl'{URL} [-> {optional-output-file-name}]; …' … ``` second: -```shell +```zsh zi ice patch'{file-name-with-the-patch-to-apply}; …' … ``` @@ -32,7 +32,7 @@ The annex will download the given `{URL}` under the path `{optional-output-file- For example, to install `fbterm`, two patches are being needed, one to fix the operation, the other one to fix the build: -```shell showLineNumbers +```zsh showLineNumbers zi ice as"command" pick"$ZPFX/bin/fbterm" \ dl"https://bugs.archlinux.org/task/46860?getfile=13513 -> ins.patch" \ dl"https://aur.archlinux.org/cgit/aur.git/plain/0001-Fix-build-with-gcc-6.patch?h=fbterm-git" \ @@ -61,7 +61,7 @@ This command will result in: Add the following snippet in the `.zshrc` file: -```shell +```zsh zi light z-shell/z-a-patch-dl ``` diff --git a/ecosystem/annexes/5_readurl.mdx b/ecosystem/annexes/5_readurl.mdx index 8a72ed779..6437be2dc 100644 --- a/ecosystem/annexes/5_readurl.mdx +++ b/ecosystem/annexes/5_readurl.mdx @@ -30,7 +30,7 @@ The part after the `|` has the same meaning as in the normal `as'…'` ice. ## Examples {/* #examples */} -```shell showLineNumbers +```zsh showLineNumbers zi id-as=fzf as='readurl|command' for \ dlink='/junegunn/fzf/releases/download/%VERSION%/fzf-%VERSION%-linux_amd64.tar.gz' \ https://github.com/junegunn/fzf/releases/ @@ -44,7 +44,7 @@ As it can be seen, the `dlink'…'` can be a relative or an absolute path and al Sometimes, like it is in the case of the [terraform][terraform-link] command, the final download link isn't on the download page, but on a page, that's listed on it. In such a case use the `dlink0'…'` ice to provide the pattern for the additional, intermediate download page, e.g.: -```shell showLineNumbers +```zsh showLineNumbers zi id-as=terraform as='readurl|command' extract for \ dlink0='/terraform/%VERSION%/' \ dlink='/terraform/%VERSION%/terraform_%VERSION%_linux_386.zip' \ @@ -55,14 +55,14 @@ zi id-as=terraform as='readurl|command' extract for \ Sometimes the URL of the download page differs from the URL of the archive in just a few `/`-sections. In such a case, it is possible to skip the `dlink'…'` ice by appending a `++`-separated fragment of the archive URL, like so: -```shell showLineNumbers +```zsh showLineNumbers zi as'readurl|command' extract for \ http://domain.com/download-page++/archive.zip ``` If the archive URL has some different `/`-sections, then it's possible to strip the conflicting ones from the download URL by using `+++`, `++++`, etc. – the number of the `/`-section that'll be stripped equals to the number of the `+` minus 2. So, for example: -```shell showLineNumbers +```zsh showLineNumbers zi as'readurl|command' extract for \ http://domain.com/download-page/removed-section+++/archive.zip ``` @@ -75,7 +75,7 @@ Sometimes the download page doesn't list the package versions from newest to old Sometimes some unwanted URLs match the `dlink'…'`/`dlink0'…'` regex/pattern. In such a case it's possible to filter them out by appending a filtering regex to the `dlink'…'` ice as: `dlink='the-main-regex~%the-unwanted-URLs-regex%'` (or the same for `dlink0'…'`). An example package that can benefit from this is the [Open Shift][open-shift-link] client, which doesn't sort the URLs from latest to the oldest – hence the exclamation mark (`!`) prepend – and it has special URLs like `stable-4.4` or `candidate-4.5` together with the regular version URLs (like `4.5.0-rc.1`): -```shell showLineNumbers +```zsh showLineNumbers zi id-as"ocp" as"readurl|command" for \ dlink0'!%VERSION%~%(stable|latest|fast|candidate).*%' \ dlink"openshift-client-windows-%VERSION%.zip" \ @@ -88,7 +88,7 @@ The above snippet of Zsh code / Zi invocation will sort the URLs (`dlink0'!…'` [Pulumi][pulumi-link], a tool to create, deploy and manage modern cloud software. -```shell showLineNumbers +```zsh showLineNumbers zi id-as'pulumi' as'readurl|null' for \ dlink='https://get.pulumi.com/releases/sdk/pulumi-%VERSION%-linux-x64.tar.gz' \ sbin'pulumi*' \ @@ -110,7 +110,7 @@ zi id-as'pulumi' as'readurl|null' for \ Add the following snippet in the `.zshrc` file: -```shell +```zsh zi light z-shell/z-a-readurl ``` diff --git a/ecosystem/annexes/6_submods.mdx b/ecosystem/annexes/6_submods.mdx index 80ed6ea25..6e3647d30 100644 --- a/ecosystem/annexes/6_submods.mdx +++ b/ecosystem/annexes/6_submods.mdx @@ -23,7 +23,7 @@ submods'{user}/{plugin} -> {output directory}; …` An example command utilizing the annex and its ice-modifier to load a plugin with additional submodules: -```shell title='~/.zshrc' showLineNumbers +```zsh title='~/.zshrc' showLineNumbers zi ice submods'zsh-users/zsh-autosuggestions -> external' zi load some/plugin ``` @@ -43,7 +43,7 @@ zi load some/plugin Add the following snippet in the `.zshrc` file: -```shell +```zsh zi light z-shell/z-a-submods ``` diff --git a/ecosystem/annexes/7_unscope.mdx b/ecosystem/annexes/7_unscope.mdx index cb6883cb5..053e8e1ca 100644 --- a/ecosystem/annexes/7_unscope.mdx +++ b/ecosystem/annexes/7_unscope.mdx @@ -147,7 +147,7 @@ Besides the GitHub-API querying, there's also a fixed, curated list of mappings Add the following snippet in the `.zshrc` file: -```shell +```zsh zi light z-shell/z-a-unscope ``` diff --git a/ecosystem/annexes/8_linkbin.mdx b/ecosystem/annexes/8_linkbin.mdx index 9cef09393..a5330f854 100644 --- a/ecosystem/annexes/8_linkbin.mdx +++ b/ecosystem/annexes/8_linkbin.mdx @@ -29,7 +29,7 @@ The optional preceding `!` flag means creating a soft link instead of a hard lin Example: -```shell {2} showLineNumbers +```zsh {2} showLineNumbers zi ice from'gh-r' as'program' \ lbin'!fzf' zi load junegunn/fzf @@ -52,7 +52,7 @@ The ice-modifier can contain globs as it will expand these when searching for th Example: -```shell {2} showLineNumbers +```zsh {2} showLineNumbers zi ice from'gh-r' as'program' \ lbin'**fzf -> myfzf' zi load junegunn/fzf @@ -91,7 +91,7 @@ The above also applies if just `!` were passed. Add the following snippet in the `.zshrc` file: -```shell +```zsh zi light z-shell/z-a-linkbin ``` diff --git a/ecosystem/annexes/9_rust.mdx b/ecosystem/annexes/9_rust.mdx index 799a89259..42d06bdaf 100644 --- a/ecosystem/annexes/9_rust.mdx +++ b/ecosystem/annexes/9_rust.mdx @@ -49,7 +49,7 @@ The crate can create so-called _shims_ – scripts that are exposed to the stand Example of the _shim_ script: -```shell showLineNumbers +```zsh showLineNumbers #!/usr/bin/env zsh function lsd { @@ -70,42 +70,42 @@ As it can be seen shim ultimately provides the binary to the command line. Set up rust and the `lsd` crate with a shim `lsd` exposing the binary: -```shell showLineNumbers +```zsh showLineNumbers zi ice rustup cargo'!lsd' zi load z-shell/0 ``` Set up rust and the `exa` crate with a shim `ls` exposing the `exa` binary: -```shell showLineNumbers +```zsh showLineNumbers zi ice rustup cargo'!exa -> ls' zi load z-shell/0 ``` Set up rust and the `exa` and `lsd` crates: -```shell showLineNumbers +```zsh showLineNumbers zi ice rustup cargo'exa;lsd' zi load z-shell/0 ``` Set up rust, then the `exa` and `lsd` crates, with their binaries exposed by altering `$PATH`: -```shell showLineNumbers +```zsh showLineNumbers zi ice rustup cargo'exa;lsd' as"command" pick"bin/(exa|lsd)" zi load z-shell/0 ``` Set up rust and then the `exa` crate with shim standard error redirected to `/dev/null`: -```shell showLineNumbers +```zsh showLineNumbers zi ice rustup cargo'!E:exa' zi load z-shell/0 ``` Just install rust and make it available globally in the system: -```shell showLineNumbers +```zsh showLineNumbers zi ice id-as"rust" wait"0" lucid rustup as"command" pick"bin/rustc" atload="export \ CARGO_HOME=\$PWD RUSTUP_HOME=\$PWD/rustup" zi load z-shell/0 @@ -113,7 +113,7 @@ zi load z-shell/0 A little more complex rustup configuration that uses [bin-gem-node][annex-bin-gem-node] annex and installs the cargo completion provided with rustup, using the [for][for-syntax] syntax: -```shell showLineNumbers +```zsh showLineNumbers zi id-as=rust wait=1 as=null sbin="bin/*" lucid rustup \ atload="[[ ! -f ${ZI[COMPLETIONS_DIR]}/_cargo ]] && zi creinstall rust; \ export CARGO_HOME=\$PWD RUSTUP_HOME=\$PWD/rustup" for \ @@ -137,7 +137,7 @@ z-shell/0 Add the following snippet in the `.zshrc` file: -```shell +```zsh zi light z-shell/z-a-rust ``` diff --git a/ecosystem/packages/01_synopsis.mdx b/ecosystem/packages/01_synopsis.mdx index 2d0668e79..ea0821f56 100644 --- a/ecosystem/packages/01_synopsis.mdx +++ b/ecosystem/packages/01_synopsis.mdx @@ -37,7 +37,7 @@ The [bin-gem-node][] annex is recommended, otherwise, some packages will fail to They allow the installation of any Gem(s) or Node module(s) locally in a newly created plugin directory. For example: -```shell showLineNumbers +```zsh showLineNumbers zi pack param='GEM -> rails' for any-gem zi pack param='MOD -> doctoc' for any-node ``` @@ -50,7 +50,7 @@ The Unicode arrow is allowed in Zi syntax as in the example below. ::: -```shell +```zsh zi id-as=jekyll pack param='GEM → jekyll' for any-gem ``` @@ -60,7 +60,7 @@ The binaries will be exposed without altering the PATH via shims. Shims are corr This way, instead of the following command used to install `fzf`: -```shell showLineNumbers +```zsh showLineNumbers zi lucid as=program pick="$ZPFX/bin/(fzf|fzf-tmux)" \ atclone="cp shell/completion.zsh _fzf_completion; \ cp bin/(fzf|fzf-tmux) $ZPFX/bin" \ @@ -70,7 +70,7 @@ zi lucid as=program pick="$ZPFX/bin/(fzf|fzf-tmux)" \ you only need: -```shell +```zsh zi pack for fzf ``` @@ -89,7 +89,7 @@ Using Zi to install software where one could use a regular package manager has s 2. **Pro:** You can influence the installation easily by specifying Zi ice-modifiers, e.g.: - ```shell + ```zsh zi pack=bgn atclone="cp fzy.1 $ZI[MAN_DIR]/man1" for fzy ``` diff --git a/ecosystem/packages/02_usage.mdx b/ecosystem/packages/02_usage.mdx index 7c95a4080..a88bf4aae 100644 --- a/ecosystem/packages/02_usage.mdx +++ b/ecosystem/packages/02_usage.mdx @@ -91,7 +91,7 @@ For all the available packages use [GitHub search][github-search]. Download, build and install the latest Apache Portable Runtime. -```shell +```zsh zi pack for apr ``` @@ -136,7 +136,7 @@ Download the Gem of asciidoctor locally with the [bin-gem-node][] annex. > Using the `@` prefix because of collision with the as'' ice. -```shell +```zsh zi pack for @asciidoctor ``` @@ -182,7 +182,7 @@ zi pack for @asciidoctor Download the binary of the Amazon-ECS-CLI command. -```shell +```zsh zi pack for ecs-cli ``` @@ -191,7 +191,7 @@ zi pack for ecs-cli Download the ECS-CLI binary with the use of the bin-gem-node annex. -```shell +```zsh zi pack"bgn" for ecs-cli ``` @@ -240,7 +240,7 @@ zi pack"bgn" for ecs-cli Download the default profile. -```shell +```zsh zi pack for dircolors-material ``` @@ -249,7 +249,7 @@ zi pack for dircolors-material Download the "no-zsh-completion" profile. -```shell +```zsh zi pack"no-zsh-completion" for dircolors-material ``` @@ -258,7 +258,7 @@ zi pack"no-zsh-completion" for dircolors-material Download the "no-color-swaps" profile. -```shell +```zsh zi pack"no-color-swaps" for dircolors-material ``` @@ -267,7 +267,7 @@ zi pack"no-color-swaps" for dircolors-material Download the minimal profile without altering the original theme. -```shell +```zsh zi pack"minimal" for dircolors-material ``` @@ -313,7 +313,7 @@ zi pack"minimal" for dircolors-material A download default profile with the Node package of doctoc. -```shell +```zsh zi pack for doctoc ``` @@ -359,7 +359,7 @@ zi pack for doctoc Download the firefox-dev latest binary. -```shell +```zsh zi pack for firefox-dev ``` @@ -368,7 +368,7 @@ zi pack for firefox-dev Download the firefox-dev latest binary with use of the [bin-gem-node][] annex. -```shell +```zsh zi pack"bgn" for firefox-dev ``` @@ -417,7 +417,7 @@ zi pack"bgn" for firefox-dev Download the package with the default profile. -```shell +```zsh zi pack for fzf ``` @@ -426,7 +426,7 @@ zi pack for fzf Download the package with the default profile + key bindings. -```shell +```zsh zi pack"default+keys" for fzf ``` @@ -435,7 +435,7 @@ zi pack"default+keys" for fzf Download the package with the [bin-gem-node][] annex. -```shell +```zsh zi pack"bgn" for fzf ``` @@ -446,7 +446,7 @@ Download the package with the [bin-gem-node][] annex and with the key bindings. > The "+keys" variants are available for each profile. -```shell +```zsh zi pack"bgn+keys" for fzf ``` @@ -455,7 +455,7 @@ zi pack"bgn+keys" for fzf Download with the [bin-gem-node][] annex from GitHub repository. -```shell +```zsh zi pack"bgn" git for fzf ``` @@ -464,7 +464,7 @@ zi pack"bgn" git for fzf Download the binary from the GitHub releases. -```shell +```zsh zi pack"binary" for fzf ``` @@ -473,7 +473,7 @@ zi pack"binary" for fzf Download the binary from the GitHub releases and install using [bin-gem-node][] + shims. -```shell +```zsh zi pack"bgn-binary" for fzf ``` @@ -522,7 +522,7 @@ zi pack"bgn-binary" for fzf Download the package with the default profile. -```shell +```zsh zi pack for fzy ``` @@ -531,7 +531,7 @@ zi pack for fzy Download the package with the [bin-gem-node][] annex. -```shell +```zsh zi pack"bgn" for fzy ``` @@ -540,7 +540,7 @@ zi pack"bgn" for fzy Download with the [bin-gem-node][] annex from GitHub repository. -```shell +```zsh zi pack"bgn" git for fzy ``` @@ -549,7 +549,7 @@ zi pack"bgn" git for fzy Download normal ice list and override atclone'' ice to skip the contrib scripts -```shell +```zsh zi pack"bgn" atclone'' for fzy ``` @@ -594,7 +594,7 @@ zi pack"bgn" atclone'' for fzy Download the default profile. -```shell +```zsh zi pack for ls_colors ``` @@ -603,7 +603,7 @@ zi pack for ls_colors Download the "no-zsh-completion" profile. -```shell +```zsh zi pack"no-zsh-completion" for ls_colors ``` @@ -612,7 +612,7 @@ zi pack"no-zsh-completion" for ls_colors Download the "no-dir-color-swap" profile. -```shell +```zsh zi pack"no-dir-color-swap" for ls_colors ``` @@ -654,7 +654,7 @@ zi pack"no-dir-color-swap" for ls_colors Default profile are using [bin-gem-node][] to set shims. -```shell +```zsh zi pack for nb ``` @@ -700,7 +700,7 @@ zi pack for nb Download the tarball with the default ice list. -```shell +```zsh zi pack for pyenv ``` @@ -709,7 +709,7 @@ zi pack for pyenv Download the binary from the GitHub releases with the [bin-gem-node][] annex. -```shell +```zsh zi pack"bgn" for pyenv ``` @@ -718,7 +718,7 @@ zi pack"bgn" for pyenv Download with the [bin-gem-node][] annex from GitHub repository. -```shell +```zsh zi pack"bgn" git for pyenv ``` @@ -763,7 +763,7 @@ zi pack"bgn" git for pyenv Download the Node package of remark-CLI, remark-man and remark-HTML -```shell +```zsh zi pack for remark ``` @@ -772,7 +772,7 @@ zi pack for remark Download the Node package of remark-CLI and remark-man -```shell +```zsh zi pack"man-only" for remark ``` @@ -781,7 +781,7 @@ zi pack"man-only" for remark Download the Node package of remark-CLI and remark-HTML -```shell +```zsh zi pack"html-only" for remark ``` @@ -829,7 +829,7 @@ Download, build and install the latest Subversion. > Dependency of Subversion: [APR][] -```shell +```zsh zi pack for subversion ``` @@ -875,7 +875,7 @@ zi pack for subversion Install the newest Zsh. -```shell +```zsh zi pack for zsh ``` @@ -884,7 +884,7 @@ zi pack for zsh Install preferred Zsh version. -```shell +```zsh zi pack"5.9" for zsh zi pack"5.8.1" for zsh zi pack"5.8" for zsh @@ -942,7 +942,7 @@ zi pack"5.1.1" for zsh Requires **root** access to install Zsh at `/usr/local` and will attempt to register it as a login shell. -```shell +```zsh zi pack for zsh-bin ``` @@ -951,7 +951,7 @@ zi pack for zsh-bin Does not require **root** access, when install using [bin-gem-node][] to set shims. -```shell +```zsh zi pack"bgn" for zsh-bin ``` @@ -960,7 +960,7 @@ zi pack"bgn" for zsh-bin Does not require **root** access, will install to `~/.local`. -```shell +```zsh zi pack"rootless" for zsh-bin ``` diff --git a/ecosystem/plugins/diff-so-fancy.mdx b/ecosystem/plugins/diff-so-fancy.mdx index 85a1f52dc..d3013f2e2 100644 --- a/ecosystem/plugins/diff-so-fancy.mdx +++ b/ecosystem/plugins/diff-so-fancy.mdx @@ -45,14 +45,14 @@ Add the following to your `.zshrc` file: Using [bin-gem-node](/ecosystem/annexes/bin-gem-node) annex (recommended): -```shell showLineNumbers +```zsh showLineNumbers zi ice as'null' sbin'bin/*' zi light z-shell/zsh-diff-so-fancy ``` Standard installation: -```shell showLineNumbers +```zsh showLineNumbers zi ice as'program' pick'bin/*' zi light z-shell/zsh-diff-so-fancy ``` diff --git a/ecosystem/plugins/f-sy-h.mdx b/ecosystem/plugins/f-sy-h.mdx index 3dedd2593..9455df52a 100644 --- a/ecosystem/plugins/f-sy-h.mdx +++ b/ecosystem/plugins/f-sy-h.mdx @@ -25,13 +25,13 @@ import ChromaFunctionExample from "@site/src/components/Markdown/_chroma_functio Add the following to your `.zshrc` file. -```shell +```zsh zi light z-shell/F-Sy-H ``` Load the plugin in [turbo mode][turbo-mode]: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zi wait lucid for \ atinit"ZI[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \ z-shell/F-Sy-H \ diff --git a/ecosystem/plugins/h-s-mw.mdx b/ecosystem/plugins/h-s-mw.mdx index 7278ec420..4ca5fa22b 100644 --- a/ecosystem/plugins/h-s-mw.mdx +++ b/ecosystem/plugins/h-s-mw.mdx @@ -44,7 +44,7 @@ The plugin allows to search history for multiple keywords, Ctrl+ Add the following to your `.zshrc` file: -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi light z-shell/H-S-MW ``` @@ -121,7 +121,7 @@ Add `zstyle` to `~/.zshrc`: `zstyle :plugin:history-search-multi-word `, Example: -```shell showLineNumbers title="~/.zshrc" +```zsh showLineNumbers title="~/.zshrc" zstyle :plugin:history-search-multi-word reset-prompt-protect 1 zstyle ":history-search-multi-word" page-size "8" ``` @@ -130,7 +130,7 @@ zstyle ":history-search-multi-word" page-size "8" For a better experience adjust history using [options][zsh-options], for example: -```shell showLineNumbers title="~/.zshrc" +```zsh showLineNumbers title="~/.zshrc" setopt extended_history # record timestamp of command in HISTFILE setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE setopt hist_ignore_all_dups # remove older duplicate entries from the history @@ -154,7 +154,7 @@ Use `zle reset-prompt` in `sched` calls, in the presence of [z-shell/F-Sy-H][z-s For example, to refresh the clock in prompt every second: -```shell showLineNumbers +```zsh showLineNumbers PROMPT=%B%F{yellow}%D{%H:%M:%S}%B%b%f schedprompt() { diff --git a/ecosystem/plugins/zbrowse.mdx b/ecosystem/plugins/zbrowse.mdx index 80560bc8b..669dd9ae3 100644 --- a/ecosystem/plugins/zbrowse.mdx +++ b/ecosystem/plugins/zbrowse.mdx @@ -32,7 +32,7 @@ First, install the [z-shell/zui][] plugin - a UI library for Z shell. Add the following to your `.zshrc`. Zi will handle cloning the plugin for you automatically the next time you start Zsh. To update run `zi update z-shell/zbrowse`. -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi load z-shell/zbrowse ``` diff --git a/ecosystem/plugins/zconvey.mdx b/ecosystem/plugins/zconvey.mdx index 58df33039..2290c9cff 100644 --- a/ecosystem/plugins/zconvey.mdx +++ b/ecosystem/plugins/zconvey.mdx @@ -76,20 +76,20 @@ The main command is `zc` (yet it is rather rarely used, I'm always sending to al Add the following to your `.zshrc` file. Zi will clone the plugin the next time you start Zsh. To update issue `zi update z-shell/zconvey`. -```shell +```zsh zi load z-shell/zconvey ``` Zi can load in [turbo mode](/search?q=turbo+and+lucid), below is an example configuration. -```shell showLineNumbers +```zsh showLineNumbers zi ice wait"0" zi light z-shell/zconvey ``` Adding `zc-bg-notify` to `$PATH`: -```shell showLineNumbers +```zsh showLineNumbers zi ice wait"0" as"command" pick"cmds/zc-bg-notify" silent zi light z-shell/zconvey ``` diff --git a/ecosystem/plugins/zi_console.mdx b/ecosystem/plugins/zi_console.mdx index c87b408fa..4162a870e 100644 --- a/ecosystem/plugins/zi_console.mdx +++ b/ecosystem/plugins/zi_console.mdx @@ -62,7 +62,7 @@ Start the console by Ctrl-O Ctrl-J keyboard shortcut, or b Standard syntax: -```shell +```zsh zi load z-shell/zi-console ``` @@ -71,7 +71,7 @@ zi load z-shell/zi-console with use of [turbo mode][4] and the [for][5] syntax: -```shell +```zsh zi wait lucid for z-shell/zi-console ``` @@ -80,7 +80,7 @@ zi wait lucid for z-shell/zi-console The plugin needs the `zsh/curses` Zsh module. You can check if it's available to your Zsh by executing: -```shell +```zsh zmodload zsh/curses ``` @@ -90,7 +90,7 @@ If the call will return an error, then the `zsh/curses` module isn't available. You can build the `zsh/curses`-equipped Z shell with Zi by the following command: -```shell showLineNumbers +```zsh showLineNumbers zi ice id-as"zsh" atclone"./.preconfig CFLAGS='-I/usr/include -I/usr/local/include -g -O2 -Wall' \ LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix='$ZPFX'" \ @@ -102,7 +102,7 @@ The command will build a custom `zsh` and install it under `$ZPFX` (`~/.zi/polar When on Gentoo, and possibly other systems, the `zsh` can still not have the ncurses library linked. To address this, utilize the [patch-dl][z-a-patch-dl] annex and automatically patch the source first: -```shell showLineNumbers +```zsh showLineNumbers zi light z-shell/z-a-patch-dl zi ice id-as"zsh" atclone"./.preconfig CFLAGS='-I/usr/include -I/usr/local/include -g -O2 -Wall' \ diff --git a/ecosystem/plugins/zprompts.mdx b/ecosystem/plugins/zprompts.mdx index fbd56dda1..b092315c0 100644 --- a/ecosystem/plugins/zprompts.mdx +++ b/ecosystem/plugins/zprompts.mdx @@ -37,7 +37,7 @@ The previews demonstrate: Add the following to your `.zshrc` file with preferred theme e.g: -```shell {2} showLineNumbers +```zsh {2} showLineNumbers zi nocd for \ atload'!promptinit; typeset -g PSSHORT=0; prompt sprint3 yellow red green blue' \ z-shell/zprompts diff --git a/ecosystem/plugins/zsh_comand_architect.mdx b/ecosystem/plugins/zsh_comand_architect.mdx index b8a9001b6..7fcea60a2 100644 --- a/ecosystem/plugins/zsh_comand_architect.mdx +++ b/ecosystem/plugins/zsh_comand_architect.mdx @@ -44,7 +44,7 @@ The Zsh Command Architect allows to copy segments of commands in history, rearra Add the following to `.zshrc`. The config files will be available in `~/.config/zca`. -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi load z-shell/zsh-cmd-architect ``` diff --git a/ecosystem/plugins/zsh_editing_workbench.mdx b/ecosystem/plugins/zsh_editing_workbench.mdx index d2d4ea264..836fc77b4 100644 --- a/ecosystem/plugins/zsh_editing_workbench.mdx +++ b/ecosystem/plugins/zsh_editing_workbench.mdx @@ -38,7 +38,7 @@ Organized shortcuts for various command line editing operations, plus new operat Add the following to `.zshrc`. The config files will be available in `~/.config/zew`. -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi load z-shell/zsh-editing-workbench ``` diff --git a/ecosystem/plugins/zsh_modules.mdx b/ecosystem/plugins/zsh_modules.mdx index 0719aada1..1e87af30e 100644 --- a/ecosystem/plugins/zsh_modules.mdx +++ b/ecosystem/plugins/zsh_modules.mdx @@ -52,7 +52,7 @@ Used by zpmod internally to speed up loading plugins with tracking (reporting). To enable debug messages from the module set: -```shell +```zsh typeset -g ZI_MOD_DEBUG=1 ``` @@ -64,7 +64,7 @@ typeset -g ZI_MOD_DEBUG=1 - To start using the module run: `zi module -B`, append `--clean` to run `make distclean`. - To display the instructions on loading the module, run: `zi module -I`. -```shell showLineNumbers +```zsh showLineNumbers zi module [-B|--build[--clean]] [-I|--info] [-r|--reset] [-h|--help] [options] zi module -B [--clean] # Build the module, append --clean to run distclean. zi module -I # Display instructions on loading the module. @@ -99,7 +99,7 @@ Change the values before loading the `zgdbm` plugin. ::: -```shell title="~/.zshrc" showLineNumbers +```zsh title="~/.zshrc" showLineNumbers zstyle ":plugin:zgdbm" cppflags "-I/usr/local/include" # Additional include directory zstyle ":plugin:zgdbm" cflags "-Wall -O2 -g" # Additional CFLAGS zstyle ":plugin:zgdbm" ldflags "-L/usr/local/lib" # Additional library directory @@ -107,7 +107,7 @@ zstyle ":plugin:zgdbm" ldflags "-L/usr/local/lib" # Additional library dir ### Install zgdbm {/* #install-zgdbm */} -```shell +```zsh zi light z-shell/zgdbm ``` diff --git a/ecosystem/plugins/zsh_navigation_tools.mdx b/ecosystem/plugins/zsh_navigation_tools.mdx index 360f24792..f13c69f62 100644 --- a/ecosystem/plugins/zsh_navigation_tools.mdx +++ b/ecosystem/plugins/zsh_navigation_tools.mdx @@ -85,7 +85,7 @@ Feature highlights include incremental multi-word searching, approximate matchin Add the following to `.zshrc`. The config files will be in `~/.config/znt`. -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi load z-shell/zsh-navigation-tools ``` @@ -143,7 +143,7 @@ Don't forget to copy [configuration files][2]. They should go to `~/.config/znt`. Moreover, `n-cd` works together with option `AUTO_PUSHD` and you should have: -```shell +```zsh setopt AUTO_PUSHD ``` @@ -169,7 +169,7 @@ After installing and reloading the shell give `ZNT` a quick try with `Ctrl-R` To have `n-history` as the incremental searcher bound to `Ctrl-R` copy `znt-*` files into the `*/site-functions` dir (unless you do a single file install) and add: -```shell showLineNumbers +```zsh showLineNumbers autoload znt-history-widget zle -N znt-history-widget bindkey "^R" znt-history-widget @@ -177,7 +177,7 @@ bindkey "^R" znt-history-widget to `.zshrc`. This is done automatically when using the installer, zgen, antigen, or single file install. Two other widgets exist, `and-cd-widget` and `znt-kill-widget`, they too can be assigned to key combinations (`autoload` is done in `.zshrc` so no need for it): -```shell showLineNumbers +```zsh showLineNumbers zle -N znt-cd-widget bindkey "^B" znt-cd-widget zle -N znt-kill-widget diff --git a/ecosystem/plugins/zsh_select.mdx b/ecosystem/plugins/zsh_select.mdx index 58c75f029..bc86177ad 100644 --- a/ecosystem/plugins/zsh_select.mdx +++ b/ecosystem/plugins/zsh_select.mdx @@ -46,7 +46,7 @@ Simply copy file `zsh-select` to any `bin` directory such as `/usr/local/bin`. Add the following to `.zshrc`. The plugin will be loaded next time you start `Zsh`. To update issue `zi update z-shell/zsh-select` from command line. -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi load z-shell/zsh-select ``` diff --git a/ecosystem/plugins/zsh_startify.mdx b/ecosystem/plugins/zsh_startify.mdx index 11edf70ec..f150c7692 100644 --- a/ecosystem/plugins/zsh_startify.mdx +++ b/ecosystem/plugins/zsh_startify.mdx @@ -38,7 +38,7 @@ Overview: The zstyles used to configure the plugin (add such commands anywhere in the `zshrc`): -```shell showLineNumbers +```zsh showLineNumbers zstyle ":plugin:zsh-startify:shellutils" size 5 # The size of the recently used file list (default: 5) zstyle ":plugin:zsh-startify:vim" size 5 # The size of the recently opened in Vim list (default: 5) ``` @@ -52,7 +52,7 @@ The Standard install loads the plugin synchronously, at the time of execution of Standard syntax without [turbo mode](/search?q=turbo+mode). -```shell showLineNumbers +```zsh showLineNumbers zi ice atload'zsh-startify' zi load z-shell/zsh-startify ``` @@ -62,7 +62,7 @@ zi load z-shell/zsh-startify Load using [turbo mode](/search?q=turbo+mode). -```shell showLineNumbers +```zsh showLineNumbers zi ice wait'0' lucid atload'zsh-startify' zi load z-shell/zsh-startify ``` diff --git a/ecosystem/plugins/zsh_unique_id.mdx b/ecosystem/plugins/zsh_unique_id.mdx index 5484fd392..175b47e3a 100644 --- a/ecosystem/plugins/zsh_unique_id.mdx +++ b/ecosystem/plugins/zsh_unique_id.mdx @@ -50,7 +50,7 @@ Default code names are: Zstyle configuration allows to customize the codenames: -```shell +```zsh zstyle :plugin:zuid codenames paper metal wood plastic # first 4 shells will have those codenames ``` @@ -72,7 +72,7 @@ Sourcing is recommended, because it can be done early, at top of zshrc, without Add the following to your `.zshrc` file. Zi will clone the plugin the next time you start zsh. To update issue `zi update z-shell/zsh-unique-id`. -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi load z-shell/zsh-unique-id ``` diff --git a/ecosystem/plugins/zui.mdx b/ecosystem/plugins/zui.mdx index a365638ef..365784c65 100644 --- a/ecosystem/plugins/zui.mdx +++ b/ecosystem/plugins/zui.mdx @@ -674,13 +674,13 @@ Returning `0` means not-updating the status window, and `reply` is then ignored. To change ZUI global default, invoke: -```shell +```zsh zstyle ":plugin:zui" colorpair "white/black" ``` An application may override such default with its default. To change the default per application, invoke: -```shell +```zsh zstyle ":plugin:zui:app:zui-demo-fly" colorpair "250/17" # 256 colors – zsh >= 5.3; "default" color also from this version ``` @@ -768,7 +768,7 @@ source {where-zui-is}/zui.plugin.zsh Add the following to your `.zshrc` file. -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi load z-shell/zui ``` diff --git a/ecosystem/plugins/zzcomplete.mdx b/ecosystem/plugins/zzcomplete.mdx index cd657b1b7..36aadee65 100644 --- a/ecosystem/plugins/zzcomplete.mdx +++ b/ecosystem/plugins/zzcomplete.mdx @@ -43,7 +43,7 @@ With ZZComplete, the user can: Add the following to your `.zshrc` file. -```shell title="~/.zshrc" +```zsh title="~/.zshrc" zi light z-shell/zzcomplete ``` From 16021bbfb0537af12767a68f1a0436ebe199a4a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 May 2026 02:12:32 +0000 Subject: [PATCH 4/7] fix: address PR review feedback for zsh highlighting Agent-Logs-Url: https://github.com/z-shell/wiki/sessions/2c76788c-a874-4a1c-8b35-33bf9c1c64a6 Co-authored-by: ss-o <59910950+ss-o@users.noreply.github.com> --- .../gallery/collection/02_completions.mdx | 4 ++-- docs/getting_started/01_installation.mdx | 2 +- src/prism/prism-zsh.js | 5 ++++- src/theme/prism-include-languages.js | 21 +++++-------------- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/community/gallery/collection/02_completions.mdx b/community/gallery/collection/02_completions.mdx index 43ed6f084..0d25014a7 100644 --- a/community/gallery/collection/02_completions.mdx +++ b/community/gallery/collection/02_completions.mdx @@ -38,7 +38,7 @@ Create your own syntax e.g: > - The ver'main' - allows selecting a specific version or branch. > - It's optional and can be removed if not required. -```zsh showlinenumbers +```zsh showLineNumbers z_lucid() { zi ice lucid ver'main' "$@" } @@ -58,7 +58,7 @@ zi_completion() { Then load as: -```zsh showlinenumbers +```zsh showLineNumbers zi_completion has'…' zi snippet … diff --git a/docs/getting_started/01_installation.mdx b/docs/getting_started/01_installation.mdx index fbfcc1291..e007b51bd 100644 --- a/docs/getting_started/01_installation.mdx +++ b/docs/getting_started/01_installation.mdx @@ -76,7 +76,7 @@ sh -c "$(curl -fsSL get.zshell.dev)" -- -a annex Install and include minimal configuration with recommended annexes and setup zdharma/zunit: -```zsh +```shell sh -c "$(curl -fsSL get.zshell.dev)" -- -a zunit ``` diff --git a/src/prism/prism-zsh.js b/src/prism/prism-zsh.js index 124c926ea..560d8f3c3 100644 --- a/src/prism/prism-zsh.js +++ b/src/prism/prism-zsh.js @@ -1,6 +1,9 @@ // Custom Prism language definition for ZSH. // Extends Prism's bash grammar with ZSH-specific builtins and project commands. (function (Prism) { + if (!Prism?.languages?.bash) { + return; + } // Clone bash grammar as the base Prism.languages.zsh = Prism.languages.extend('bash', {}); @@ -38,4 +41,4 @@ alias: 'attr-value', }, }); -})(Prism); +})(globalThis.Prism); diff --git a/src/theme/prism-include-languages.js b/src/theme/prism-include-languages.js index 51326ade3..429220b97 100644 --- a/src/theme/prism-include-languages.js +++ b/src/theme/prism-include-languages.js @@ -1,25 +1,14 @@ // Swizzled Docusaurus prism-include-languages. -// Loads standard additionalLanguages from prismjs, then registers the custom ZSH grammar. -import siteConfig from '@generated/docusaurus.config'; +// Delegates standard additionalLanguages loading to the original implementation, +// then registers the custom ZSH grammar. +import prismIncludeLanguagesOriginal from '@theme-original/prism-include-languages'; export default function prismIncludeLanguages(PrismObject) { - const { - themeConfig: {prism}, - } = siteConfig; - const {additionalLanguages} = prism; + prismIncludeLanguagesOriginal(PrismObject); - // Mount PrismObject on globalThis temporarily — prismjs components expect it there. + // Register custom ZSH grammar (must load after bash, which is in additionalLanguages) const PrismBefore = globalThis.Prism; globalThis.Prism = PrismObject; - - additionalLanguages.forEach((lang) => { - if (lang === 'php') { - require('prismjs/components/prism-markup-templating.js'); - } - require(`prismjs/components/prism-${lang}`); - }); - - // Register custom ZSH grammar (must load after bash, which is in additionalLanguages) require('../prism/prism-zsh.js'); // Restore globalThis.Prism From 6012639155316faa50e8c27dd183c5e988187531 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 May 2026 02:20:42 +0000 Subject: [PATCH 5/7] docs(zunit): mark zunit init examples as zsh fences Agent-Logs-Url: https://github.com/z-shell/wiki/sessions/e1acf6bd-e68a-4ed6-8487-b8c5fc8a82d5 Co-authored-by: ss-o <59910950+ss-o@users.noreply.github.com> --- community/04_zunit/01_installation.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/community/04_zunit/01_installation.mdx b/community/04_zunit/01_installation.mdx index c20392bbd..a71686018 100644 --- a/community/04_zunit/01_installation.mdx +++ b/community/04_zunit/01_installation.mdx @@ -61,7 +61,7 @@ zi load z-shell/zunit Once ZUnit is installed, `zunit init` sets up a new project in one command: -```sh +```zsh cd my-project zunit init ``` @@ -79,7 +79,7 @@ tests/ To also generate a GitHub Actions workflow: -```sh +```zsh zunit init --github-actions ``` From acd0ee240617086e1ea55a7777021900fae9e50f Mon Sep 17 00:00:00 2001 From: Sall <59910950+ss-o@users.noreply.github.com> Date: Sun, 17 May 2026 03:29:32 +0100 Subject: [PATCH 6/7] Update build script in CI workflow Signed-off-by: Sall <59910950+ss-o@users.noreply.github.com> --- .github/workflows/ci-perf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-perf.yml b/.github/workflows/ci-perf.yml index d7d3917c1..490ef7507 100644 --- a/.github/workflows/ci-perf.yml +++ b/.github/workflows/ci-perf.yml @@ -59,7 +59,7 @@ jobs: - uses: preactjs/compressed-size-action@v3 with: install-script: pnpm i --frozen-lockfile - build-script: "pnpm build:en" + build-script: "build:en" pattern: "{build/assets/js/*.js,build/assets/css/*.css,build/**/*.html,.docusaurus/globalData.json,build/blog/**/swiss-army-knife-for-zsh/*}" exclude: "{./build/manifest.json,./build/**/*.xml,**/*.map,**/node_modules/**,build/assets/**/*.ttf}" strip-hash: '\.([^;]\w{7})\.' From 834f37be00c2361ef7acb5da17553e66727da45b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 May 2026 02:30:22 +0000 Subject: [PATCH 7/7] style(prism): add richer zsh token color palette Agent-Logs-Url: https://github.com/z-shell/wiki/sessions/da846b7a-ce9e-4b26-aecf-2941cecebb52 Co-authored-by: ss-o <59910950+ss-o@users.noreply.github.com> --- src/css/custom.css | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/css/custom.css b/src/css/custom.css index 9e09737ff..18b9a93a9 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -32,6 +32,9 @@ --ifm-background-color: hsl(0deg 0% 100%); --ifm-navbar-background-color: var(--ifm-background-surface-color); --docusaurus-highlighted-code-line-bg: hsl(0deg 0% 0% / 15%); + --site-zsh-token-command-color: hsl(15deg 85% 45%); + --site-zsh-token-builtin-color: hsl(198deg 100% 35%); + --site-zsh-token-expansion-color: hsl(273deg 65% 45%); --docusaurus-announcement-bar-height: auto; /* ── Design system tokens ── */ @@ -84,6 +87,9 @@ --ifm-color-primary-light: hsl(var(--site-primary-hue-saturation-light) 54%); --ifm-color-primary-lighter: hsl(var(--site-primary-hue-saturation-light) 62%); --ifm-color-primary-lightest: hsl(var(--site-primary-hue-saturation-light) 73%); + --site-zsh-token-command-color: hsl(25deg 95% 70%); + --site-zsh-token-builtin-color: hsl(198deg 100% 75%); + --site-zsh-token-expansion-color: hsl(288deg 85% 80%); color-scheme: dark; } @@ -95,6 +101,21 @@ border-left: 3px solid var(--site-color-error-border); } +/* ZSH syntax palette */ +code.language-zsh .token.zi-command, +code.language-zsh .token.zunit-command { + color: var(--site-zsh-token-command-color); + font-weight: 700; +} + +code.language-zsh .token.zsh-builtin { + color: var(--site-zsh-token-builtin-color); +} + +code.language-zsh .token.zsh-expansion-flag { + color: var(--site-zsh-token-expansion-color); +} + .navbar--dark { --ifm-navbar-background-color: var(--site-color-navbar-dark); --ifm-navbar-link-hover-color: var(--ifm-color-primary);