Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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})\.'
Expand Down
4 changes: 2 additions & 2 deletions community/01_zsh_guide/01_roadmap/10_expansion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
10 changes: 5 additions & 5 deletions community/02_zsh_plugin_standard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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
```
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -494,7 +494,7 @@ some_array[1]=state

can be converted into:

```shell showLineNumbers
```zsh showLineNumbers
typeset -A PlgMap

PlgMap[state]=1
Expand Down
6 changes: 3 additions & 3 deletions community/03_zsh_native_scripting_handbook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]}} )
Expand Down Expand Up @@ -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}}" )
Expand Down
4 changes: 2 additions & 2 deletions community/04_zunit/01_installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -79,7 +79,7 @@ tests/

To also generate a GitHub Actions workflow:

```sh
```zsh
zunit init --github-actions
```

Expand Down
2 changes: 1 addition & 1 deletion community/gallery/collection/01_collection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
48 changes: 24 additions & 24 deletions community/gallery/collection/02_completions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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' "$@"
}
Expand All @@ -58,7 +58,7 @@ zi_completion() {

Then load as:

```shell showlinenumbers
```zsh showLineNumbers
zi_completion has'…'
zi snippet …

Expand All @@ -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

Expand All @@ -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"

Expand Down
Loading
Loading