{"id":16617349,"url":"https://github.com/ryooooooga/zabrze","last_synced_at":"2026-03-11T05:11:17.462Z","repository":{"id":37860233,"uuid":"395945694","full_name":"Ryooooooga/zabrze","owner":"Ryooooooga","description":"zsh abbreviation expansion plugin","archived":false,"fork":false,"pushed_at":"2024-10-12T14:04:32.000Z","size":178,"stargazers_count":40,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T12:06:48.089Z","etag":null,"topics":["zle-widgets","zsh","zsh-plugin","zsh-plugins"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ryooooooga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-14T08:38:22.000Z","updated_at":"2025-03-13T01:52:17.000Z","dependencies_parsed_at":"2023-02-08T18:45:16.330Z","dependency_job_id":"3b42c015-259d-4079-a44c-2e5fc74c55be","html_url":"https://github.com/Ryooooooga/zabrze","commit_stats":{"total_commits":92,"total_committers":2,"mean_commits":46.0,"dds":"0.021739130434782594","last_synced_commit":"84bbaf432ddaae0ee436698efb426fdf1510c4ae"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryooooooga%2Fzabrze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryooooooga%2Fzabrze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryooooooga%2Fzabrze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryooooooga%2Fzabrze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ryooooooga","download_url":"https://codeload.github.com/Ryooooooga/zabrze/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485287,"owners_count":20946398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["zle-widgets","zsh","zsh-plugin","zsh-plugins"],"created_at":"2024-10-12T02:16:19.245Z","updated_at":"2026-01-24T05:10:57.256Z","avatar_url":"https://github.com/Ryooooooga.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zabrze\n\n[![](https://github.com/Ryooooooga/zabrze/actions/workflows/build.yml/badge.svg)](https://github.com/Ryooooooga/zabrze/actions/workflows/build.yml)\n[![](https://badgen.net/crates/v/zabrze)](https://crates.io/crates/zabrze)\n\nZSH abbreviation expansion plugin\n\n## Usage\n\n### Simple abbreviation\n\n```toml\n# ~/.config/zabrze/config.toml\n[[snippets]]\nname = \"git\"\ntrigger = \"g\"\nsnippet = \"git\"\n\n[[snippets]]\nname = \"awk '{print $1}'\"\ntrigger = \".1\"\nsnippet = \"awk '{print $1}'\"\n```\n\n```zsh\n$ eval \"$(zabrze init --bind-keys)\"\n```\n\nthen\n\n```zsh\n$ g\u003cSP\u003e\n#  ↓ expanded\n$ git\n\n$ cat a.txt | .1\u003cCR\u003e\n#  ↓ expanded and executed\n$ cat a.txt | awk '{print $1}'\n```\n\n### Global abbreviation\n\n```toml\n[[snippets]]\nname = \"\u003e/dev/null 2\u003e\u00261\"\ntrigger = \"null\"\nsnippet = \"\u003e/dev/null 2\u003e\u00261\"\nglobal = true\n```\n\n```zsh\n$ echo a null\u003cSP\u003e\n#  ↓ expanded\n$ echo a \u003e/dev/null 2\u003e\u00261\n```\n\n### Global abbreviation with context\n\n```toml\n[[snippets]]\nname = \"git commit\"\ntrigger = \"c\"\nsnippet = \"commit\"\nglobal = true\ncontext = '^git\\s'\n\n[[snippets]]\nname = \"git commit -m\"\ntrigger = \"cm\"\nsnippet = \"commit -m '{}'\"\ncursor = \"{}\"  # optional; defaults to \"{}\"\nglobal = true\ncontext = '^git\\s'\n\n[[snippets]]\nname = \"branch name\"\ntrigger = \"B\"\nsnippet = \"$(git symbolic-ref --short HEAD)\"\nevaluate = true\nglobal = true\ncontext = '^git\\s'\n```\n\n```zsh\n$ git c\u003cSP\u003e\n#  ↓ expanded\n$ git commit\n\n$ git cm\u003cSP\u003e\n#  ↓ expanded and move into quotes\n$ git commit -m '|'\n\n$ git push -d origin B\u003cCR\u003e\n#  ↓ expanded and executed\n$ git push -d origin main\n```\n\n### Conditional abbreviation\n\n```toml\n[[snippets]]\nname = \"chrome\"\ntrigger = \"chrome\"\nsnippet = \"open -a 'Google Chrome'\"\nif = '[[ \"$OSTYPE\" =~ darwin ]]'  # only available in macOS\n\n[[snippets]]\nname = \"trash\"\ntrigger = \"rm\"\nsnippet = \"trash\"\nif = \"(( ${+commands[trash]} ))\"  # available if trash is installed\n\n[[snippets]]\nname = \"rm -r\"\ntrigger = \"rm\"\nsnippet = \"rm -r\"  # fallback\n```\n\n### Suffix alias\n\n```toml\n[[snippets]]\nname = \"python3 *.py\"\ntrigger-pattern = '^(?\u003cfile\u003e.+\\.py)$'\nsnippet = \"python3 $file\"\nevaluate = true\n\n# or\n[[snippets]]\nname = \"python3 *.py\"\ntrigger-pattern = '\\.py$'\nsnippet = \"python3 $trigger\"\nevaluate = true\n```\n\n```zsh\n$ ./a.py\u003cCR\u003e\n#  ↓ expanded and executed\n$ python3 ./a.py\n```\n\n## Installation\n\n### From prebuilt binary\n\nYou can download a binary release [here](https://github.com/Ryooooooga/zabrze/releases).\n\n### zinit\n\n```zsh\nzinit blockf light-mode as\"program\" from\"gh-r\" for \\\n    atload'eval \"$(zabrze init --bind-keys)\"' \\\n    Ryooooooga/zabrze\n```\n\n### Cargo\n\n```zsh\n$ cargo install zabrze\n```\n\n### Homebrew\n\n```zsh\n$ brew install ryooooooga/tap/zabrze\n```\n\n## Configuration\n\n\u003e ⚠️ **Note:** YAML configuration format is deprecated. Please use TOML instead.\n\nzabrze reads configuration files from the following locations:\n\n- `$ZABRZE_CONFIG_HOME` if set, otherwise `$XDG_CONFIG_HOME/zabrze` (defaults to `$HOME/.config/zabrze`)\n- Configuration files are read in lexicographical order.\n- Supported file extensions are `toml` (recommended), `yaml` (deprecated), and `yml` (deprecated).\n\nThe configuration file (TOML) defines a list of abbreviations. Each abbreviation has the following properties:\n\n- `name` (string): A descriptive name for the abbreviation.\n- `trigger` (string, required, mutually exclusive with `trigger-pattern`): The abbreviation to expand.\n- `trigger-pattern` (string, required, mutually exclusive with `trigger`): A regular expression to match the abbreviation.\n- `snippet` (string, required): The text to replace the abbreviation with.\n- `global` (boolean): A boolean value indicating whether the abbreviation should be expanded globally. Defaults to `false`.\n- `context` (string): A regular expression that must match the beginning of the line for the abbreviation to be expanded.\n- `evaluate` (boolean): A boolean value indicating whether the snippet should be evaluated as a shell command. Defaults to `false`.\n- `if` (string): A conditional expression that must evaluate to true for the abbreviation to be expanded.\n- `cursor` (string or `null`): A string that specifies the cursor position after expansion. Defaults to `{}`.\n- `abort-on-error` (boolean): **Experimental:** When `evaluate` is `true`, this option controls the behavior when a command inside the snippet fails. If `true`, the snippet expansion will be aborted if the command substitution fails. Defaults to `false`.\n\n## Alternatives\n\n- [zsh-abbrev-alias](https://github.com/momo-lab/zsh-abbrev-alias)\n- [zeno.zsh](https://github.com/yuki-yano/zeno.zsh)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryooooooga%2Fzabrze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryooooooga%2Fzabrze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryooooooga%2Fzabrze/lists"}