├── .all-contributorsrc ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── accepted_feature_request.yml │ ├── bug_report.yml │ └── config.yml └── workflows │ └── publish-release.yaml ├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── ROADMAP.md ├── bin └── changelog ├── community.md ├── completions └── _abbr ├── docs └── releasing.md ├── man └── man1 │ └── abbr.1 ├── performance ├── README.md ├── fresh-install │ ├── setup │ └── skel │ │ └── .zshenv ├── not-installed │ ├── setup │ └── skel │ │ └── .zshenv ├── one-hundred-abbreviations │ ├── setup │ └── skel │ │ ├── .zshenv │ │ ├── .zshrc │ │ └── user-abbreviations ├── ten-abbreviations │ ├── setup │ └── skel │ │ ├── .zshenv │ │ ├── .zshrc │ │ └── user-abbreviations └── zero-abbreviations │ ├── setup │ └── skel │ ├── .zshenv │ ├── .zshrc │ └── user-abbreviations ├── tests ├── README.md ├── abbr-add.ztr.zsh ├── abbr-clear-session.ztr.zsh ├── abbr-config.ztr.zsh ├── abbr-erase.ztr.zsh ├── abbr-expand.ztr.zsh ├── abbr-history.ztr.zsh ├── abbr-import-aliases.ztr.zsh ├── abbr-import-git.ztr.zsh ├── abbr-rename.ztr.zsh ├── abbr-tmpdir.ztr.zsh ├── index.ztr.zsh ├── test-gitconfig └── tests.plugin.zsh ├── zsh-abbr.plugin.zsh └── zsh-abbr.zsh /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "zsh-abbr", 3 | "projectOwner": "olets", 4 | "contributorsSortAlphabetically": true, 5 | "files": [ 6 | "README.md", 7 | "community.md" 8 | ], 9 | "commitConvention": "angular", 10 | "contributorsPerLine": 7, 11 | "contributors": [ 12 | { 13 | "login": "olets", 14 | "name": "Henry Bley-Vroman", 15 | "avatar_url": "https://avatars.githubusercontent.com/u/3282350?v=4", 16 | "profile": "https://olets.dev", 17 | "contributions": [ 18 | "doc", 19 | "design", 20 | "question", 21 | "tool", 22 | "example", 23 | "ideas", 24 | "infra", 25 | "test", 26 | "maintenance", 27 | "review" 28 | ] 29 | }, 30 | { 31 | "login": "knu", 32 | "name": "Akinori MUSHA", 33 | "avatar_url": "https://avatars.githubusercontent.com/u/10236?v=4", 34 | "profile": "https://github.com/knu", 35 | "contributions": [ 36 | "code" 37 | ] 38 | }, 39 | { 40 | "login": "alwinw", 41 | "name": "Alwin Wang", 42 | "avatar_url": "https://avatars.githubusercontent.com/u/16846521?v=4", 43 | "profile": "http://researchgate.net/profile/Alwin_Wang", 44 | "contributions": [ 45 | "code" 46 | ] 47 | }, 48 | { 49 | "login": "henrebotha", 50 | "name": "Henré Botha", 51 | "avatar_url": "https://avatars.githubusercontent.com/u/5593874?v=4", 52 | "profile": "https://github.com/henrebotha", 53 | "contributions": [ 54 | "code", 55 | "ideas", 56 | "financial", 57 | "doc", 58 | "bug" 59 | ] 60 | }, 61 | { 62 | "login": "hojerst", 63 | "name": "Stefan Hojer", 64 | "avatar_url": "https://avatars.githubusercontent.com/u/436889?v=4", 65 | "profile": "https://www.stefanhojer.de/", 66 | "contributions": [ 67 | "code", 68 | "bug", 69 | "userTesting" 70 | ] 71 | }, 72 | { 73 | "login": "LucasLarson", 74 | "name": "Lucas Larson", 75 | "avatar_url": "https://avatars.githubusercontent.com/u/91468?v=4", 76 | "profile": "https://lucaslarson.net", 77 | "contributions": [ 78 | "bug" 79 | ] 80 | }, 81 | { 82 | "login": "burneyy", 83 | "name": "Daniel Berninghoff", 84 | "avatar_url": "https://avatars.githubusercontent.com/u/7356251?v=4", 85 | "profile": "https://berninghoff.eu", 86 | "contributions": [ 87 | "code" 88 | ] 89 | }, 90 | { 91 | "login": "shimajiteppei", 92 | "name": "Teppei Shimaji", 93 | "avatar_url": "https://avatars.githubusercontent.com/u/42309359?v=4", 94 | "profile": "https://shimajiteppei.github.io/", 95 | "contributions": [ 96 | "code", 97 | "doc" 98 | ] 99 | }, 100 | { 101 | "login": "z0rc", 102 | "name": "Ihor Urazov", 103 | "avatar_url": "https://avatars.githubusercontent.com/u/787519?v=4", 104 | "profile": "https://github.com/z0rc", 105 | "contributions": [ 106 | "doc" 107 | ] 108 | }, 109 | { 110 | "login": "Icy-Thought", 111 | "name": "Icy-Thought", 112 | "avatar_url": "https://avatars.githubusercontent.com/u/53710398?v=4", 113 | "profile": "https://github.com/Icy-Thought", 114 | "contributions": [ 115 | "platform" 116 | ] 117 | }, 118 | { 119 | "login": "Farid-NL", 120 | "name": "Farid NL", 121 | "avatar_url": "https://avatars.githubusercontent.com/u/34426099?v=4", 122 | "profile": "https://github.com/Farid-NL", 123 | "contributions": [ 124 | "code" 125 | ] 126 | } 127 | ], 128 | "commitType": "docs" 129 | } 130 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | @olets -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/accepted_feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Accepted feature request 2 | description: If a Discussions discussion led to the acceptance of a feature request, write it up here. 3 | title: "[Feature request] " 4 | labels: [needs triage, enhancemet] 5 | body: 6 | - type: checkboxes 7 | id: update-title 8 | attributes: 9 | label: Update the issue title 10 | description: Replace `` with a description of the feature 11 | options: 12 | - label: I have updated the title 13 | required: true 14 | - type: textarea 15 | id: feature 16 | attributes: 17 | label: Feature 18 | validations: 19 | required: true 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: If you've confirmed something is broken, create a bug report. 3 | title: "[Bug report] " 4 | labels: [needs triage] 5 | body: 6 | - type: checkboxes 7 | id: prereqs 8 | attributes: 9 | label: Is there an existing issue for this? 10 | description: Please search to see if an issue already exists for the bug you encountered. 11 | options: 12 | - label: I have searched the existing issues 13 | required: true 14 | - type: checkboxes 15 | id: update-title 16 | attributes: 17 | label: Update the issue title 18 | description: Replace `` with a description of the bug 19 | options: 20 | - label: I have updated the title 21 | required: true 22 | - type: textarea 23 | id: expected-behavior 24 | attributes: 25 | label: Expected Behavior 26 | description: A concise description of what you expected to happen. 27 | validations: 28 | required: false 29 | - type: textarea 30 | id: actual-behavior 31 | attributes: 32 | label: Actual Behavior 33 | description: A concise description of what you're experiencing. 34 | validations: 35 | required: false 36 | - type: textarea 37 | id: steps-to-reproduce 38 | attributes: 39 | label: Steps To Reproduce 40 | description: Steps to reproduce the behavior. 41 | placeholder: | 42 | 1. In this environment... 43 | 2. With this config... 44 | 3. Run '...' 45 | 4. See error... 46 | validations: 47 | required: false 48 | - type: textarea 49 | id: environment 50 | attributes: 51 | label: Environment 52 | description: Run `abbr profile` and paste the result here. 53 | render: shell 54 | validations: 55 | required: true 56 | - type: dropdown 57 | id: installation-method 58 | attributes: 59 | label: Installation method 60 | description: Select the installation method you use. 61 | options: 62 | - Plugin manager 63 | - Homebrew 64 | - Manual 65 | - Other 66 | - Don't Know 67 | validations: 68 | required: true 69 | - type: textarea 70 | id: installation-method-details 71 | attributes: 72 | label: Installation method details 73 | description: | 74 | If you use a plugin manager, which one and what version? 75 | 76 | If you selected "Manual" or "Other" provide any info you think might be useful. 77 | 78 | If you selected "Don't Know", run `echo $ABBR_SOURCE_PATH` and paste the output here. (If the output includes sensitive information, censor it - for example `/Users/myusername/zsh-abbr`) 79 | validations: 80 | required: false 81 | - type: textarea 82 | attributes: 83 | label: Anything else? 84 | description: | 85 | Links? References? Anything that will give us more context about the issue you are encountering! 86 | 87 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. 88 | validations: 89 | required: false 90 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Get Help 4 | url: https://github.com/olets/zsh-abbr/discussions/new?category=help 5 | about: If you can't get something to work the way you expect, open a question in our discussion forums. 6 | - name: Feature Request 7 | url: https://github.com/olets/zsh-abbr/discussions/new?category=ideas 8 | about: 'Suggest any ideas you have using our discussion forums.' 9 | - name: Documentation Issue 10 | url: https://github.com/olets/zsh-abbr-v5-docs/issues/new/choose 11 | about: 'For issues related to the documentation site, suggest changes on our documentation repository.' -------------------------------------------------------------------------------- /.github/workflows/publish-release.yaml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | release: 5 | types: [released] 6 | jobs: 7 | homebrew: 8 | name: Bump Homebrew formula 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Bump primary formula 12 | uses: mislav/bump-homebrew-formula-action@b3327118b2153c82da63fd9cbf58942146ee99f0 # v3.1 13 | if: "contains(github.ref, 'v6')" 14 | with: 15 | formula-name: zsh-abbr 16 | formula-path: zsh-abbr.rb 17 | homebrew-tap: olets/homebrew-tap 18 | download-url: https://github.com/olets/zsh-abbr.git 19 | commit-message: | 20 | feat({{formulaName}}): publish {{version}} 21 | 22 | Created by https://github.com/mislav/bump-homebrew-formula-action 23 | env: 24 | COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }} 25 | 26 | - name: Bump v6.x formula 27 | uses: mislav/bump-homebrew-formula-action@b3327118b2153c82da63fd9cbf58942146ee99f0 # v3.1 28 | if: "contains(github.ref, 'v6')" 29 | with: 30 | formula-name: zsh-abbr@6 31 | formula-path: zsh-abbr@6.rb 32 | homebrew-tap: olets/homebrew-tap 33 | download-url: https://github.com/olets/zsh-abbr.git 34 | commit-message: | 35 | feat({{formulaName}}): publish {{version}} 36 | 37 | Created by https://github.com/mislav/bump-homebrew-formula-action 38 | env: 39 | COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }} 40 | 41 | - name: Bump v5.x formula 42 | uses: mislav/bump-homebrew-formula-action@b3327118b2153c82da63fd9cbf58942146ee99f0 # v3.1 43 | if: "contains(github.ref, 'v5')" 44 | with: 45 | formula-name: zsh-abbr@5 46 | formula-path: zsh-abbr@5.rb 47 | homebrew-tap: olets/homebrew-tap 48 | commit-message: | 49 | feat({{formulaName}}): publish {{version}} 50 | 51 | Created by https://github.com/mislav/bump-homebrew-formula-action 52 | env: 53 | COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }} 54 | 55 | - name: Bump v4.x formula 56 | uses: mislav/bump-homebrew-formula-action@b3327118b2153c82da63fd9cbf58942146ee99f0 # v3.1 57 | if: "contains(github.ref, 'v4')" 58 | with: 59 | formula-name: zsh-abbr@4 60 | formula-path: zsh-abbr@4.rb 61 | homebrew-tap: olets/homebrew-tap 62 | commit-message: | 63 | feat({{formulaName}}): publish {{version}} 64 | 65 | Created by https://github.com/mislav/bump-homebrew-formula-action 66 | env: 67 | COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }} 68 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | tests/*.tmp 2 | *.zwc 3 | *.tar.gz -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "zsh-job-queue"] 2 | path = zsh-job-queue 3 | url = https://github.com/olets/zsh-job-queue 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # [6.2.1](https://github.com/olets/zsh-abbr/compare/v6.2.0...v6.2.1) (2025-02-21) 2 | 3 | ### Bug Fixes 4 | 5 | - **expansion:** do not conflate empty or all-whitespace buffer with '1'... [[#160](https://github.com/olets/zsh-abbr/issues/160)] ([7eda3c1](https://github.com/olets/zsh-abbr/commit/7eda3c1da75c6580bd3791feed24ca261b2d05ac)) 6 | 7 | # [6.2.0](https://github.com/olets/zsh-abbr/compare/v6.1.0...v6.2.0) (2025-02-15) 8 | 9 | ### Bug Fixes 10 | 11 | - **abbr:** positional arg delimiter is standalone '--' [[#162](https://github.com/olets/zsh-abbr/issues/162)] ([24201fb](https://github.com/olets/zsh-abbr/commit/24201fba248ba6612f834eb37a1e22c6093fd9d4)) 12 | 13 | ### Features 14 | 15 | - **abbr:** no flag order opinion ([d4c5b06](https://github.com/olets/zsh-abbr/commit/d4c5b061ea23b68fa8791b5660084cd519b8a2c5)) 16 | - **job-queue:** major upgrade to latest 2.x 'main' ([8a20b54](https://github.com/olets/zsh-abbr/commit/8a20b54fd43ef1a022f566623a112d6f88e353af)) 17 | - **completions:** With thanks to [@Farid-NL](https://github.com/Farid-NL) (see PR [#128](https://github.com/olets/zsh-abbr/pull/128)) 18 | - Tab completion of options (and don't suggest equivalent options twice (no `--session` suggested if `-S` already in place)) 19 | - Tab completion of abbreviations in `erase` and `rename` 20 | 21 | # [6.1.0](https://github.com/olets/zsh-abbr/compare/v6.0.1...v6.1.0) (2025-02-10) 22 | 23 | ### Bug Fixes 24 | 25 | - **erase:** support carets in abbreviations [[#118](https://github.com/olets/zsh-abbr/issues/118)] ([5884606](https://github.com/olets/zsh-abbr/commit/5884606ad83c5ec0baca8ee0be964a883787535c)) 26 | - also adds support for hash symbols in abbreviations 27 | 28 | ### Features 29 | 30 | - **expand:** fail if no expansion is found ([48625de](https://github.com/olets/zsh-abbr/commit/48625dec74f01805e8910857a82e03d7c7266802)) 31 | 32 | # [6.0.1](https://github.com/olets/zsh-abbr/compare/v6.0.0...v6.0.1) (2024-12-10) 33 | 34 | This is a no-changes release to document and announce impactful updates to associated repos. [[#156](https://github.com/olets/zsh-abbr/issues/156)] 35 | 36 | - The `zsh-abbr` and `zsh-abbr@6` Homebrew formulae successfully install zsh-abbr. 37 | - The GitHub release has an associated working archive. 38 | - The documentation site's manual installation snippet works. 39 | - The documentation site includes solutions for installing with zgen, zit, zr, and zsh4humans. 40 | 41 | # [6.0.0](https://github.com/olets/zsh-abbr/compare/v6.0.0-beta.2...v6.0.0) (2024-11-12) 42 | 43 | ⚠️ Has breaking changes. If you do advanced configuration, read the [migration guide](https://zsh-abbr.olets.dev/migrating-between-versions.html) and/or read about [pinning v5.x](https://v5.zsh-abbr.olets.dev/installation.html). 44 | 45 | is now the v6 docs. The v5 docs are available at . 46 | 47 | - 🆕 [Save to history](https://zsh-abbr.olets.dev/history.html) 48 | - 🆕 [Prefixes](https://zsh-abbr.olets.dev/prefixes.html) 49 | - 🆕 [Reminders](https://zsh-abbr.olets.dev/reminders.html) 50 | - Drops everything that was deprecated in v5.x 51 | 52 | See also the v6.0.0 beta releases' release notes, below. 53 | 54 | ### Bug Fixes 55 | 56 | - **cursor:** do not treat markers as patterns [[#140](https://github.com/olets/zsh-abbr/issues/140)] ([4449f42](https://github.com/olets/zsh-abbr/commit/4449f42ee91108ed74e1bb8ac721ebb82781998a)) 57 | 58 | # [6.0.0-beta.2](https://github.com/olets/zsh-abbr/compare/v6.0.0-beta.2...v6.0.0-beta.2) (2024-10-31) 59 | 60 | ### Bug Fixes 61 | 62 | - **reminders**: fix [[#154](https://github.com/olets/zsh-abbr/issues/154)] 63 | 64 | # [6.0.0-beta.1](https://github.com/olets/zsh-abbr/compare/v6.0.0-beta.2...v6.0.0-beta.1) (2024-10-29) 65 | 66 | Drop deprecated things; introduce history, prefixes, and reminders. 67 | 68 | # [5.8.3](https://github.com/olets/zsh-abbr/compare/v5.8.2...v5.8.3) (2024-10-08) 69 | 70 | ### Bug Fixes 71 | 72 | - **sync user:** 'mv': do not follow aliases or custom functions [[#149](https://github.com/olets/zsh-abbr/issues/149)] ([58e0896](https://github.com/olets/zsh-abbr/commit/58e08966ced20c131e9b59b0cc14fb01e35a4881)) 73 | 74 | ### Features 75 | 76 | - **github:** 'accepted feature request' issue template ([4a5b1c9](https://github.com/olets/zsh-abbr/commit/4a5b1c99adf21fb80a087d7ddf78cbbd7acadb56)) 77 | - **publish-release workflow:** pin mislav/bump-homebrew-formula-action at v3.1 ([07a02be](https://github.com/olets/zsh-abbr/commit/07a02be62468468124cd0baaeac025a511381f13)) 78 | 79 | ### Tests 80 | 81 | Increase coverage, including some breaking tests related to [#118](https://github.com/olets/zsh-abbr/issues/118). 82 | 83 | # [5.8.2](https://github.com/olets/zsh-abbr/compare/v5.8.1...v5.8.2) (2024-07-29) 84 | 85 | Cleans up a Git conflict resolution mistake. 86 | 87 | # [5.8.1](https://github.com/olets/zsh-abbr/compare/v5.8.0...v5.8.1) (2024-07-29) 88 | 89 | ### Features 90 | 91 | - **abbr-expand-and-space:** deprecation warning points to abbr-expand-and-insert ([752e9fc](https://github.com/olets/zsh-abbr/commit/752e9fcc4daff680545c30f8f857913d66f6f5e6)) 92 | - **internal fns:** prep for making internal only ([805a236](https://github.com/olets/zsh-abbr/commit/805a2367cd6bc5cdc63a3786833651485c46396d)) 93 | 94 | # [5.8.0](https://github.com/olets/zsh-abbr/compare/v5.7.1...v5.8.0) (2024-05-23) 95 | 96 | ### Bug Fixes 97 | 98 | - **abbr-expand-and-accept:** redefine accept-line, for auto zsh-autosuggestions support [[#91](https://github.com/olets/zsh-abbr/issues/91)] ([04b9b83](https://github.com/olets/zsh-abbr/commit/04b9b83fdf453e465cb1fd43ee829bfb608a5cbc)) 99 | 100 | ### Features 101 | 102 | - **abbr-expand-and-accept:** respect user-defined accept-line widget ([3bac1fc](https://github.com/olets/zsh-abbr/commit/3bac1fc57e2b7a73a9bb1e47364becbe2715d150)) 103 | - **init:** do not choke if user sources zshrc in interactive shell ([f59b7aa](https://github.com/olets/zsh-abbr/commit/f59b7aadefda4947a22407cdf666b8e2a7194bf5)) 104 | 105 | # [5.7.1](https://github.com/olets/zsh-abbr/compare/v5.7.0...v5.7.1) (2024-05-18) 106 | 107 | - **completions:** correct version number ([fa4ca0e](https://github.com/olets/zsh-abbr/commit/fa4ca0e1436e60548ee0c1b637e1fc250c168a7b)) 108 | 109 | # [5.7.0](https://github.com/olets/zsh-abbr/compare/v5.6.0...v5.7.0) (2024-05-17) 110 | 111 | ### Features 112 | 113 | - **changelog:** script ([e3235c9](https://github.com/olets/zsh-abbr/commit/e3235c96289fc6a6a8f52f313e196f66ae8975f4)) 114 | - **tmpdir:** new internal var instead of mutating user config var ([d42a692](https://github.com/olets/zsh-abbr/commit/d42a69256296ddca39706e15993a60578d05ba5f)) 115 | 116 | # [5.6.0](https://github.com/olets/zsh-abbr/compare/v5.5.0...v5.6.0) (2024-05-16) 117 | 118 | ### Bug Fixes 119 | 120 | - missing quotation mark ([a19f0b2](https://github.com/olets/zsh-abbr/commit/a19f0b2e155c3eece602d8c24a26eb22c0bbc4fa)) 121 | 122 | ### Features 123 | 124 | - **ABBR_TMPDIR:** distinct paths for un/privileged users [[#54](https://github.com/olets/zsh-abbr/issues/54)] ([b740b01](https://github.com/olets/zsh-abbr/commit/b740b0166d50f339e19dcde6c240cd8761e5df8d)) 125 | - **ABBR_TMPDIR:** support configurations without trailing slash. Thanks to @ealap ([7103519](https://github.com/olets/zsh-abbr/commit/71035198f805e947eb0434faeed772bc6d6d15ac)) 126 | 127 | # [5.5.0](https://github.com/olets/zsh-abbr/compare/v5.4.1...v5.5.0) (2024-05-16) 128 | 129 | **⚠️ Yanked ⚠️** 130 | 131 | # [5.4.1](https://github.com/olets/zsh-abbr/compare/v5.4.0...v5.4.1) (2024-03-08) 132 | 133 | ### Bug Fixes 134 | 135 | - **abbr-expand-and-space:** available to zle while deprecated ([bb4ac60](https://github.com/olets/zsh-abbr/commit/bb4ac6011e73579b6f1e10bb08d7e291d6746be8)) 136 | 137 | # [5.4.0](https://github.com/olets/zsh-abbr/compare/v5.3.0...v5.4.0) (2024-03-08) 138 | 139 | ### Features 140 | 141 | Cursor placement! With thanks to [@burneyy](https://github.com/burneyy) (see [#63](https://github.com/olets/zsh-abbr/pull/63)) 142 | 143 | - **abbr-expand widget:** support placing cursor [[#110](https://github.com/olets/zsh-abbr/issues/110)] ([6c688e0](https://github.com/olets/zsh-abbr/commit/6c688e019852df16b70c928bbd87c1b5d3f0382b)) 144 | - If `ABBR_SET_EXPANSION_CURSOR` (default `0`) is non-zero, the expansion's first instance of `ABBR_EXPANSION_CURSOR_MARKER` (default `$ABBR_CURSOR_MARKER` (see below)) will be replaced with the cursor 145 | - **abbr-expand-and-insert:** 146 | - replaces deprecated `abbr-expand-and-space` ([36667ce](https://github.com/olets/zsh-abbr/commit/36667cecd26a50ad082f6b83df6c5913e52d6e59)) 147 | - support checking buffer for cursor stops ([52c9d3a](https://github.com/olets/zsh-abbr/commit/52c9d3a1e029dc17214716dbc63bd658e861682f)) 148 | - If `ABBR_SET_LINE_CURSOR` (default `0`) is non-zero and the cursor wasn't placed during expansion, the buffer's first instance of `ABBR_LINE_CURSOR_MARKER` (default `%`) will be replaced with the cursor 149 | 150 | # [5.3.0](https://github.com/olets/zsh-abbr/compare/v5.2.0...v5.3.0) (2024-01-02) 151 | 152 | ### Features 153 | 154 | With this release, running tests requires zsh-test-runner v2.x 155 | 156 | - **jobs:** use zsh epoch time instead of date command [[#106](https://github.com/olets/zsh-abbr/issues/106)] ([f3dcaf5](https://github.com/olets/zsh-abbr/commit/f3dcaf5e73306a6b201100962400e04667a4033d)) 157 | - **tests:** support current shell and subshell ([070e903](https://github.com/olets/zsh-abbr/commit/070e90360af65fe092eccecb1f91e4dcb60cc182)) 158 | - **tests:** temp file is deleted ([7c02ea5](https://github.com/olets/zsh-abbr/commit/7c02ea51f8f66cdb5b4756e04d30f8c8376a34ea)) 159 | - **tests:** temp file is deleted ([7c02ea5](https://github.com/olets/zsh-abbr/commit/7c02ea51f8f66cdb5b4756e04d30f8c8376a34ea)) 160 | 161 | # [5.2.0](https://github.com/olets/zsh-abbr/compare/v5.1.0...v5.2.0) (2023-10-19) 162 | 163 | Adds command completion and deprecates access to some internal functions. 164 | 165 | ### Bug Fixes 166 | 167 | - **precmd:** no noise output ([eaec694](https://github.com/olets/zsh-abbr/commit/eaec6948ab8a57705743e3e83fac7c9fe73c52be)) 168 | 169 | ### Features 170 | 171 | #### Completions 172 | 173 | - **completions:** add for abbr commands [[#104](https://github.com/olets/zsh-abbr/issues/104)] ([e67b3e1](https://github.com/olets/zsh-abbr/commit/e67b3e10e41d6a3ef72c975855fddb7504116417)) 174 | - **completions:** import-git-aliases suggests files [[#104](https://github.com/olets/zsh-abbr/issues/104)] ([74dfcc6](https://github.com/olets/zsh-abbr/commit/74dfcc67f030d4a572a3c047f3e469a4aac1ea04)) 175 | 176 | #### Deprecations 177 | 178 | - **\_abbr:util_deprecated:** deprecate ([431ea27](https://github.com/olets/zsh-abbr/commit/431ea27a5c1029879c30576cd885dd44cc9eb685)) 179 | - **add, erase:** do not export abbreviations_set variable ([c25eb0b](https://github.com/olets/zsh-abbr/commit/c25eb0b25229cae64633fa7ea2df0af7b7530b64)) 180 | - **initialization:** deprecate exported fns, use local instead... ([d941318](https://github.com/olets/zsh-abbr/commit/d941318d5cb197205d320dc723676fa9e5c5d1ab)) 181 | - **precmd:** deprecate ([e341f87](https://github.com/olets/zsh-abbr/commit/e341f870591055cad302a3a953ddf7604c894277)) 182 | 183 | #### Other 184 | 185 | - **warn deprecation:** replacement is optional ([f2a33e6](https://github.com/olets/zsh-abbr/commit/f2a33e65608a8c24d3fd8b8c3f09f7c89b4af581)) 186 | 187 | # [5.1.0](https://github.com/olets/zsh-abbr/compare/v5.0.1...v5.1.0) (2023-05-26) 188 | 189 | ### Features 190 | 191 | - **add:** support force [[#90](https://github.com/olets/zsh-abbr/issues/90)] ([7a3b6a4](https://github.com/olets/zsh-abbr/commit/7a3b6a4284502f8460294423243693cfd13fc78d)) 192 | - **rename:** support force ([9be7b46](https://github.com/olets/zsh-abbr/commit/9be7b46fa1274e2ff16efe8e2e43ab74bfb01484)) 193 | 194 | # [5.0.1](https://github.com/olets/zsh-abbr/compare/v5.0.0...v5.0.1) (2023-03-19) 195 | 196 | ### Bug Fixes 197 | 198 | - **expand:** quotation marks are preserved ([2cb3613](https://github.com/olets/zsh-abbr/commit/2cb3613d0bb584507b6fb8744c7b3ce61fba5abc)) 199 | - Corrected false-negative tests 200 | 201 | ### Features 202 | 203 | - **expand:** support multi-word string ([70663b1](https://github.com/olets/zsh-abbr/commit/70663b1955427e988671b6e2f34e296c766a673f)) 204 | - Test suite runs multiple file, logs file names 205 | 206 | # [5.0.0](https://github.com/olets/zsh-abbr/compare/v4.9.3...v5.0.0) (2023-02-23) 207 | 208 | Has breaking changes. See the [migration guide](https://zsh-abbr.olets.dev/migrating-between-versions). 209 | 210 | - 🆕 Support for [multi-word abbreviations](https://zsh-abbr.olets.dev/essential-commands) 211 | - 🆕 New documentation site 212 | - 🆕 [`abbr git`](https://v5.zsh-abbr.olets.dev/commands.html#git) command! 213 | - 📄 Default `ABBR_USER_ABBREVIATIONS_FILE` is now `${XDG_CONFIG_HOME:-$HOME/.config}/zsh-abbr/user-abbreviations` (but if you have a file in the legacy path `${XDG_CONFIG_HOME:-$HOME/.config}/zsh/abbreviations`, that will be used instead) 214 | - ⚠️ zsh-syntax-highlighting users have to update their snippets 215 | - ⚠️ All features deprecated in the latest v4.x are dropped 216 | - License's ethics requirements are now Hippocratic License v3 (was HL v2.1) 217 | 218 | For details see v5.0.0.beta-x release notes below. 219 | 220 | # [5.0.0.beta-8](https://github.com/olets/zsh-abbr/compare/v5.0.0.beta-6...v5.0.0.beta-8) (2023-02-20) 221 | 222 | ### Features 223 | 224 | From 4.9.3: 225 | 226 | - **actions:** publishing releases automatically bumps homebrew ([a87679d](https://github.com/olets/zsh-abbr/commit/a87679d3097e4c9f1c536f94a700b88900387c33)) 227 | - **bench:** add configs ([4277de1](https://github.com/olets/zsh-abbr/commit/4277de1dec3726527c50c59376fc2fa4fa822f9d)) 228 | 229 | # [5.0.0.beta-7](https://github.com/olets/zsh-abbr/compare/v5.0.0.beta-6...v5.0.0.beta-7) (2023-02-10) 230 | 231 | ### Bug Fixes 232 | 233 | From v4.9.2: 234 | 235 | - **binaries:** delete file missed in 347f2fa [[#73](https://github.com/olets/zsh-abbr/issues/73)] ([627490b](https://github.com/olets/zsh-abbr/commit/627490b169b3011a69491df5b536c264f7278900)) 236 | 237 | From v4.9.1: 238 | 239 | - **man:** correct version and release date ([a6ae1c9](https://github.com/olets/zsh-abbr/commit/a6ae1c972356f092602276a0d369f34f56b5a6cc)) 240 | 241 | # [5.0.0.beta-6](https://github.com/olets/zsh-abbr/compare/v5.0.0.beta-5...v5.0.0.beta-6) (2023-01-05) 242 | 243 | ### Features 244 | 245 | - **user file:** default is now /zsh-abbr/user-abbreviations ([aa3e42f](https://github.com/olets/zsh-abbr/commit/aa3e42f7f2c62559c406f97c26a1722072e4ca01)) 246 | 247 | # [5.0.0.beta-5](https://github.com/olets/zsh-abbr/compare/v5.0.0.beta-4...v5.0.0.beta-5) (2022-12-23) 248 | 249 | ### Features 250 | 251 | From v4.9: 252 | 253 | - **profile:** new command ([4ba4bc8](https://github.com/olets/zsh-abbr/commit/4ba4bc8831d1b3bbd228570a212160494955cc2f)) 254 | 255 | # [5.0.0.beta-4](https://github.com/olets/zsh-abbr/compare/v5.0.0.beta-3...v5.0.0.beta-4) (2022-12-23) 256 | 257 | ### Bug Fixes 258 | 259 | From v4.8.4: 260 | 261 | - **expand and accept:** check for zsh-autosuggestion widget ([8c84b54](https://github.com/olets/zsh-abbr/commit/8c84b54af78b6f541e49ec4279a8bb7506b7c381)) 262 | 263 | # [5.0.0.beta-3](https://github.com/olets/zsh-abbr/compare/v5.0.0.beta-2...v5.0.0.beta-3) (2022-12-16) 264 | 265 | ### Bug Fixes 266 | 267 | From v4.8.3: 268 | 269 | - **expand-and-accept:** accepting clears zsh-autosuggestions' suggestions [[#67](https://github.com/olets/zsh-abbr/issues/67)] ([a994077](https://github.com/olets/zsh-abbr/commit/a994077e1614d2aed0e07557b3b6452da956868a)) 270 | 271 | ### Features 272 | 273 | From v4.8.3: 274 | 275 | - **expand-and-accept:** use zsh-autosuggestions' recommendation for how to clear suggestions ([a994077](https://github.com/olets/zsh-abbr/commit/a994077e1614d2aed0e07557b3b6452da956868a)) 276 | 277 | # [5.0.0.beta-2](https://github.com/olets/zsh-abbr/compare/v5.0.0.beta-1...v5.0.0.beta-2) (2022-11-19) 278 | 279 | ### Features 280 | 281 | From v4.8.2: 282 | 283 | - **binaries:** remove [[#65](https://github.com/olets/zsh-abbr/issues/65)] ([a1a530b](https://github.com/olets/zsh-abbr/commit/a1a530bdae2d3a6a85885c1b890d632265c528b4)) 284 | 285 | # [5.0.0.beta-1](https://github.com/olets/zsh-abbr/compare/v4.8.0...v5.0.0.beta-1) (2022-11-06) 286 | 287 | Notably the first release of multi-word abbreviations and the move of the documentation out of the README and into a dedicated site. 288 | 289 | ### Features 290 | 291 | - **multi-word abbreviations**! Thanks to [@henrebotha](https://github.com/henrebotha) for discussion in [#32](https://github.com/olets/zsh-abbr/issues/32) 292 | - add ([641d94f](https://github.com/olets/zsh-abbr/commit/641d94f77f11c13faae01b141c9d9801bd795f3a)) 293 | - erase, expand ([218cd8e](https://github.com/olets/zsh-abbr/commit/218cd8e497ade6efd40d3c5bf1c32a9b07b0e717)), ([2a3f111](https://github.com/olets/zsh-abbr/commit/2a3f11193f9ac5f669fa4e3ce7a9e30d677e64d9)) 294 | - import-git-aliases ([c98729b](https://github.com/olets/zsh-abbr/commit/c98729ba691c72a8340138dce382a0c7192c45c9)) 295 | - rename ([5c2308f](https://github.com/olets/zsh-abbr/commit/5c2308f2cc2ac781f054140421d755aac8bd0e51)) 296 | - **contributors:** use all-contributors ([32da6fb](https://github.com/olets/zsh-abbr/commit/32da6fb74f7688851e03d52eaa838084ce811b83)) 297 | - **erase,add:** remove some possibly unnecessary quoting ([02b84b5](https://github.com/olets/zsh-abbr/commit/02b84b551fba7c4f853d3feddb48637ae9033983)) 298 | - **expand:** try all substrings from longest to shortest ([4d8ea0f](https://github.com/olets/zsh-abbr/commit/4d8ea0ffd8acd74e8a4216764bba219c343cc09c)) 299 | - **git:** support new subcommand ([364a4b0](https://github.com/olets/zsh-abbr/commit/364a4b006cdc6ab9d558f2c7fbc14e4bc8f850fd)), ([ceeca77](https://github.com/olets/zsh-abbr/commit/ceeca776155201f3115ca5a5c01f24db58716751)) 300 | - **import-git-aliases:** create only one type ([9979861](https://github.com/olets/zsh-abbr/commit/997986107e4e8c883b44c660b6d7af957d90777d)) 301 | - **license:** 302 | - Hippocratic License v3 is released. Apply it in place of v2.1 clause ([584be08](https://github.com/olets/zsh-abbr/commit/584be08fa0dee1daf03568e76f45a54946dfb96c)) 303 | - add Sky's Edge-inspired stipulations ([1c4c501](https://github.com/olets/zsh-abbr/commit/1c4c50147ef9e79b37f49a5e901599a1f906330e)) 304 | - **widgets:** drop support for deprecated names ([6aedbe9](https://github.com/olets/zsh-abbr/commit/6aedbe94297263a39b1f3b6bbaee7685e7a73787)) 305 | 306 | # [4.9.5](https://github.com/olets/zsh-abbr/compare/v4.9.3...v4.9.5) (2023-02-24) 307 | 308 | Updates in support of v5.0.0's release 309 | 310 | # [4.9.4](https://github.com/olets/zsh-abbr/compare/v4.9.3...v4.9.4) (2023-02-21) 311 | 312 | Update release date 313 | 314 | # [4.9.3](https://github.com/olets/zsh-abbr/compare/v4.9.2...4.9.3) (2023-02-21) 315 | 316 | ### Features 317 | 318 | - **actions:** publishing releases automatically bumps homebrew ([a87679d](https://github.com/olets/zsh-abbr/commit/a87679d3097e4c9f1c536f94a700b88900387c33)) 319 | - **bench:** add configs ([4277de1](https://github.com/olets/zsh-abbr/commit/4277de1dec3726527c50c59376fc2fa4fa822f9d)) 320 | 321 | # [4.9.2](https://github.com/olets/zsh-abbr/compare/v4.9.1...v4.9.2) (2023-02-10) 322 | 323 | ### Bug Fixes 324 | 325 | - **binaries:** delete file missed in 347f2fa [[#73](https://github.com/olets/zsh-abbr/issues/73)] ([627490b](https://github.com/olets/zsh-abbr/commit/627490b169b3011a69491df5b536c264f7278900)) 326 | 327 | # [4.9](https://github.com/olets/zsh-abbr/compare/v4.8.4...v4.9) (2022-12-28) 328 | 329 | ### Features 330 | 331 | - **profile:** new command ([4ba4bc8](https://github.com/olets/zsh-abbr/commit/4ba4bc8831d1b3bbd228570a212160494955cc2f)) 332 | 333 | # [4.8.4](https://github.com/olets/zsh-abbr/compare/v4.8.3...v4.8.4) (2022-12-23) 334 | 335 | ### Bug Fixes 336 | 337 | - **expand and accept:** check for zsh-autosuggestion widget ([53a8b06](https://github.com/olets/zsh-abbr/commit/53a8b06a4e210fd9456cd1a83034d153be9589b5)) 338 | 339 | # [4.8.3](https://github.com/olets/zsh-abbr/compare/v4.8.2...v4.8.3) (2022-12-16) 340 | 341 | ### Bug Fixes 342 | 343 | - **expand-and-accept:** accepting clears zsh-autosuggestions' suggestions [[#67](https://github.com/olets/zsh-abbr/issues/67)] ([752cef8](https://github.com/olets/zsh-abbr/commit/752cef83eed89912ebed68c54d9c07241b8b60e8)) 344 | 345 | ### Features 346 | 347 | - **expand-and-accept:** use zsh-autosuggestions' recommendation for how to clear suggestions ([c71302d](https://github.com/olets/zsh-abbr/commit/c71302df14e10c6227367b02901027b77f753711)) 348 | 349 | # [4.8.2](https://github.com/olets/zsh-abbr/compare/v4.8.1...v4.8.2) (2022-11-19) 350 | 351 | ### Features 352 | 353 | - **binaries:** remove [[#65](https://github.com/olets/zsh-abbr/issues/65)] ([347f2fa](https://github.com/olets/zsh-abbr/commit/347f2fa0c6b0a4069acc56dabd86911f04d777e5)) 354 | 355 | # [4.8.1](https://github.com/olets/zsh-abbr/compare/v4.8.0...v4.8.1) (2022-11-10) 356 | 357 | ### Features 358 | 359 | - **widgets:** deprecate functions which were not dropped in v4.1.0... ([8a01f32](https://github.com/olets/zsh-abbr/commit/8a01f32514257422a4d50484e22a1ea40386f098)) 360 | 361 | # [4.8.0](https://github.com/olets/zsh-abbr/compare/v4.7.1...v4.8.0) (2022-09-08) 362 | 363 | ### Features 364 | 365 | - **user abbreviation file:** respect XDG_CONFIG_HOME if defined (unless there's already an abbreviations file in the old default location), with [@qubidt](https://github.com/qubidt) ([5d59cd0](https://github.com/olets/zsh-abbr/commit/5d59cd0a62af1367aa4e6f0f548ee00914031013), [2df61f9](https://github.com/olets/zsh-abbr/commit/2df61f96f142e7ba13ffecbaae1256254608cf25)) 366 | 367 | # [4.7.1](https://github.com/olets/zsh-abbr/compare/v4.7.0...v4.7.1) (2022-01-03) 368 | 369 | Copyright update 370 | 371 | # [4.7.0](https://github.com/olets/zsh-abbr/compare/v4.6.0...v4.7.0) (2021-12-30) 372 | 373 | ### Breaking 374 | 375 | - **widgets:** drop support for functions deprecated in 4.1.0 ([4166395](https://github.com/olets/zsh-abbr/commit/4166395f623ab44cfe992afd7d8d4e904f9aa9ea)) 376 | 377 | ### Features 378 | 379 | - **init:** no unnecessary NO_COLOR checks ([da5205a](https://github.com/olets/zsh-abbr/commit/da5205ab5b9a5508d0ca818cceb7dc27fc0d83fa)) 380 | 381 | # [4.6.0](https://github.com/olets/zsh-abbr/compare/v4.5.0...v4.6.0) (2021-09-24) 382 | 383 | - `--version` shows the correct version number again. 384 | 385 | ### Features 386 | 387 | - **license:** new license ([cfe5abb](https://github.com/olets/zsh-abbr/commit/cfe5abb2c16fa5ceb4fd6b965b5667c69e375628)) 388 | 389 | # [4.5.0](https://github.com/olets/zsh-abbr/compare/v4.4.0...v4.5.0) (2021-09-14) 390 | 391 | _In this version `abbr -v` gives `zsh-abbr version 4.4.0`_ 392 | 393 | ### Bug Fixes 394 | 395 | - **temp files:** account for possibility of garbage cleaning [[#42](https://github.com/olets/zsh-abbr/issues/42)] ([38ffea2](https://github.com/olets/zsh-abbr/commit/38ffea289e31980e52d140868cdb4d0adf475e56)) 396 | 397 | ### Features 398 | 399 | - **color:** more reliable respect for NO_COLOR ([4706cf4](https://github.com/olets/zsh-abbr/commit/4706cf4722debb7ca2d9b9cc0b7089c74c89fd4b)) 400 | 401 | # [4.4.0](https://github.com/olets/zsh-abbr/compare/v4.3.0...v4.4.0) (2021-08-1) 402 | 403 | ### Features 404 | 405 | - **add:** use --quieter to silence 'command expands' logs, idea from [@knu](https://github.com/olets/zsh-abbr/commits?author=knu) in [#38](https://github.com/olets/zsh-abbr/issues/38) ([8c02d9a](https://github.com/olets/zsh-abbr/commit/8c02d9affd1820be9dad9df9f8c3e992d5725b5b)) 406 | 407 | ### Bug Fixes 408 | 409 | - **help:** show manpage regardless of installation method ([55c4c29](https://github.com/olets/zsh-abbr/commit/55c4c2916f153717269c6ef8a77a14608548ab28)) 410 | 411 | ### Other 412 | 413 | The README now includes instructions for importing macOS substitutions, by [@mortenscheel](https://github.com/olets/zsh-abbr/commits?author=mortenscheel) ([99af045](https://github.com/olets/zsh-abbr/commit/99af0455b7b86ff3894a4bcf73380be2d595fa54)) 414 | 415 | # [4.3.0](https://github.com/olets/zsh-abbr/compare/v4.3.0...v4.3.0) (2021-03-28) 416 | 417 | ### Features 418 | 419 | - **tests:** use zsh-test-runner (ztr) ([da2b0b9](https://github.com/olets/zsh-abbr/commit/da2b0b989b57e0828a766f330ccc0b2df889f8e3)) 420 | 421 | # [4.2.1](https://github.com/olets/zsh-abbr/compare/v4.2.0...v4.2.1) (2021-02-28) 422 | 423 | ### Features 424 | 425 | - **echo:** always use builtin ([093269a](https://github.com/olets/zsh-abbr/commit/093269a6a687dd28cb4d5c5122809725c8724998)) 426 | - **tests:** new harness + support skipping ([b884a9f](https://github.com/olets/zsh-abbr/commit/b884a9f533c6f2ca1bd696ad056e06c6257b0bff)) 427 | - **rm:** Make sure "rm" is run as command and not as alias, by [@hojerst](https://github.com/olets/zsh-abbr/commits?author=hojerst) ([d275169](https://github.com/olets/zsh-abbr/commit/d275169fe16be53dcaad93e4ad18d1bb1d11d542)) 428 | 429 | # [4.2.0](https://github.com/olets/zsh-abbr/compare/v4.1.2...v4.2.0) (2020-12-13) 430 | 431 | ### Features 432 | 433 | - **add:** logs always include type and scope ([70ee858](https://github.com/olets/zsh-abbr/commit/70ee8580402bc7ce766ecfac4f57c22bf0ec8f3d)) 434 | - **import-git-aliases:** respect multiline Git aliases ([#30](https://github.com/olets/zsh-abbr/issues/30) / PR [#31](https://github.com/olets/zsh-abbr/issues/31)) by [@henrebotha](https://github.com/olets/zsh-abbr/commits?author=henrebotha) ([5deee28](https://github.com/olets/zsh-abbr/commit/5deee288b1c29441358922f437b9e04c2d99c86d)) 435 | - **import-git-aliases:** support specifying config file path ([31fca3f](https://github.com/olets/zsh-abbr/commit/31fca3f21103c2ddcb02b69b6d4c62a3fc7b988c)) 436 | 437 | # [v4.1.2](https://github.com/olets/zsh-abbr/compare/v4.1.1...v4.1.2) (2020-11-02) 438 | 439 | ### Bug Fixes 440 | 441 | - **expand and accept:** autosuggestions not required [[#28](https://github.com/olets/zsh-abbr/issues/28)] ([7cdc57a](https://github.com/olets/zsh-abbr/commit/7cdc57a58f83b9ec929fdfd955716df97ee58919)) 442 | 443 | # [v4.1.1](https://github.com/olets/zsh-abbr/compare/v4.1.0...v4.1.1) (2020-10-27) 444 | 445 | ### Bug Fixes 446 | 447 | - **homebrew:** shas match (empty) [[#27](https://github.com/olets/zsh-abbr/issues/27)] ([97b5fc2](https://github.com/olets/zsh-abbr/commit/97b5fc25205614d85b6a53f72b997935afa20d93)) 448 | 449 | # [v4.1.0](https://github.com/olets/zsh-abbr/compare/v4.0.2...v4.1.0) (2020-10-24) 450 | 451 | Friendlier widget names, and syntax highlighting snippets for `zsh-syntax-highlighting`. 452 | 453 | ### Features 454 | 455 | - **deprecations:** reinstate support for warnings + add example forms ([73c4626](https://github.com/olets/zsh-abbr/commit/73c4626c06f6d0d7a50e83f1f32a0d614f84116e)) 456 | - **widgets:** rename widgets, deprecate old names, add precmd ([35a2c15](https://github.com/olets/zsh-abbr/commit/35a2c155636dfd4510646fa51d80c1a9d01059c1)) 457 | - **precmd:** add precmd logging ([35a2c15](https://github.com/olets/zsh-abbr/commit/35a2c155636dfd4510646fa51d80c1a9d01059c1)) 458 | 459 | # [v4.0.2](https://github.com/olets/zsh-abbr/compare/v4.0.1...v4.0.2) (2020-09-14) 460 | 461 | ### Bug Fixes 462 | 463 | - **init:** all initialization happens in function [[#22](https://github.com/olets/zsh-abbr/issues/22)] ([8bbaa84](https://github.com/olets/zsh-abbr/commit/8bbaa841254e95b22144243d317f95051be31bf0)) 464 | 465 | ### Features 466 | 467 | - **abbr_job_pop:** use command 'rm' ([15e383b](https://github.com/olets/zsh-abbr/commit/15e383b8fff34fe14cf5191fe420f86d16058bd7)) 468 | 469 | # [v4.0.1](https://github.com/olets/zsh-abbr/compare/v4.0.0...v4.0.1) (2020-08-23) 470 | 471 | `abbr e -g ` finished with the log message "regular user abbreviation". No longer! And polishes up tests. 472 | 473 | ### Bug Fixes 474 | 475 | - **fix,refactor(logs):** correct type and scope ([a5a4171](https://github.com/olets/zsh-abbr/commit/a5a4171d448f3ee2cfe83d8c1dc8fa2063bb3e2c)) 476 | 477 | # [v4.0.0](https://github.com/olets/zsh-abbr/compare/v3.3.4...v4.0.0) (2020-07-26) 478 | 479 | ### Bug Fixes 480 | 481 | - **dry run:** message appended to log ([4dd118f](https://github.com/olets/zsh-abbr/commit/4dd118f5d5aadf67fd45a55d7f149c2203a97efa)) 482 | 483 | ### Features 484 | 485 | - **abbreviations arrays:** prefix var names with ABBR\_ ([fef023b](https://github.com/olets/zsh-abbr/commit/fef023b9a626d27a417ae272ece371aef4eae396)) 486 | - **color:** do not load module if NO_COLOR is set ([25264ae](https://github.com/olets/zsh-abbr/commit/25264ae99b5d8254aac08887109d7553358bb31f)) 487 | - **export aliases:** drop support for output path arg ([35b9274](https://github.com/olets/zsh-abbr/commit/35b92744ab244e03d17751d9b330884f5e8de8c1)) 488 | - **list, list-abbreviations:** swap; list is default ([39fd84d](https://github.com/olets/zsh-abbr/commit/39fd84d3863911242141993edadb10a07e446281)) 489 | - **quiet:** does not silence dry run message ([0a4d5b6](https://github.com/olets/zsh-abbr/commit/0a4d5b66df109c00279c835b48c8616aebd2902b)) 490 | - **subcommands:** drop support and messages for deprecateds ([f1b0ce7](https://github.com/olets/zsh-abbr/commit/f1b0ce705d1323b6ea62a714cb319408fa694a07)) 491 | - **temp files:** new global var ABBR_TMPDIR ([2fa0e88](https://github.com/olets/zsh-abbr/commit/2fa0e88404a721e589fbc89d66719f490188e718)) 492 | - **temp files:** no longer clean up v<3.2 temp files ([f15ab53](https://github.com/olets/zsh-abbr/commit/f15ab53a6a88442210f49d08b6a6539dd7babb1b)) 493 | - **variables, functions:** drop support for 'zsh\_' prefix... ([7557ef4](https://github.com/olets/zsh-abbr/commit/7557ef44b2eb9fae951241146b17305b2319b4e5)) 494 | 495 | # [v.3.3.4](https://github.com/olets/zsh-abbr/compare/v3.3.3...v) (2020-07-26) 496 | 497 | Deprecates `ABBR_USER_PATH` in favor of `ABBR_USER_ABBREVIATIONS_FILE`. 498 | 499 | # [v3.3.3](https://github.com/olets/zsh-abbr/compare/v3.3.2...v3.3.3) (2020-06-14) 500 | 501 | Fix a session abbreviations bug, support NO_COLOR, and polish deprecation warnings. 502 | 503 | ### Bug Fixes 504 | 505 | - **session abbreviations:** do not unintentionally clear ([113ffc6](https://github.com/olets/zsh-abbr/commit/113ffc6c10b53bd2bbdea5b8838ba89d598434f3)) 506 | 507 | ### Features 508 | 509 | - **config:** deprecate ABBR_DEFAULT_BINDINGS 'true'/'false' (use 0/1) ([5f25f1c](https://github.com/olets/zsh-abbr/commit/5f25f1cb8b8232beee15d77ae24af44895a8dcc5)) 510 | - **debugging:** deprecate ZSH\_-prefixed var name ([2b5de18](https://github.com/olets/zsh-abbr/commit/2b5de186411a32dc7e1414669133bb2411eb59ca)) 511 | - **deprecation:** post-init warnings for non-init config vars ([69d73b8](https://github.com/olets/zsh-abbr/commit/69d73b827d4cab1a10f6941a60c6b6cf6f8b4ffe)) 512 | - **deprecation message:** use warning color ([fd53852](https://github.com/olets/zsh-abbr/commit/fd5385294cc4c32627cb90f60cc0748a160a69b8)) 513 | - **output:** support NO_COLOR (see https://no-color.org/) ([54f16db](https://github.com/olets/zsh-abbr/commit/54f16dbd2be2e3913a8013822d9b1dd30664706a)) 514 | 515 | # [v3.3.2](https://github.com/olets/zsh-abbr/compare/v3.3.1...v3.3.2) (2020-06-06) 516 | 517 | Save some keystrokes! `--` and `-` prefixes in actions are deprecated. Just say `add`, `clear-session`, `erase`, `expand`, `export-aliases`, `help`, `import-aliases`, `import-fish`, `import-git-aliases`, `list`, `list-abbreviations`, `list-commands`, `rename`, and `version`, or their single letter short forms (`--help` and `--version` are not deprecated, for findability; `-L` is not deprecated to match zsh's `alias -L`). 518 | 519 | Advanced users no longer need to source zshrc after directly (ie not via the abbr CLI) editing the user abbreviations file to prevent against the possibility of losing data when subsequently running abbr actions in an open session. Details in the README. 520 | 521 | Also a fix for Oh-My-Zsh users, and protection against the possibility that builtins have been redefined by aliases and that zsh emulation has been set to another shell. 522 | 523 | ### Bug Fixes 524 | 525 | - **omz:** plugin file is executable ([e2f6632](https://github.com/olets/zsh-abbr/commit/e2f6632e014675526fbb70d19af5923bb0286891)) 526 | 527 | ### Features 528 | 529 | - **abbr:** argument can be a supported parameter's name... ([47cfb6a](https://github.com/olets/zsh-abbr/commit/47cfb6a7afd86357f1ea87ac99ce8f14a42c8fe3)) 530 | - **add:** dry run, command overwriting, and log messages play nice ([9a17c8b](https://github.com/olets/zsh-abbr/commit/9a17c8b2e3d38b93bb101b0ff9437d620cd5ce46)) 531 | - **add:** wrap 'command', using builtin ([042e68d](https://github.com/olets/zsh-abbr/commit/042e68dbc07b64e8ff7a569825e9585aa00d9c61)) 532 | - **autoload:** support opting out with env var ([9658a67](https://github.com/olets/zsh-abbr/commit/9658a677bd03ac60654ea6f382b344d8671c552c)) 533 | - **commands:** deprecate dash prefixes ([3f75f57](https://github.com/olets/zsh-abbr/commit/3f75f575090dc9ffdb90f0010db8443e07e507b7)) 534 | - **data:** manual changes are taken into account... ([00abe87](https://github.com/olets/zsh-abbr/commit/00abe87ef059f92c0cbd5a091e5c4c4e12a01929)) 535 | - **echo:** wrap builtin ([c4ee8e2](https://github.com/olets/zsh-abbr/commit/c4ee8e2292493a63fda8fd64fbc2887dd0528f75)) 536 | - **emulation:** emulate zsh in all functions ([f644f1a](https://github.com/olets/zsh-abbr/commit/f644f1ad41daf968df768c80ff7fa32836f00cba)) 537 | - **error:** do not push the help command ([379ae70](https://github.com/olets/zsh-abbr/commit/379ae7043e6a593e87fa2fe9060232e457bf2ded)) 538 | - **import aliases:** wrap alias command ([cbb9bb5](https://github.com/olets/zsh-abbr/commit/cbb9bb504f9be74ab42a793177b9278fd6f308cc)) 539 | - **list-commands:** deprecate --show, s ([fd58b39](https://github.com/olets/zsh-abbr/commit/fd58b39550c30aaf7f4ee09c8a6ccb9917156bcc)) 540 | - **loading:** always reload user file ([3776076](https://github.com/olets/zsh-abbr/commit/3776076b7ab4d9e06fc93fc9fb3261c1d201f789)) 541 | - **warnings:** do not cause an error exit code ([f8b02be](https://github.com/olets/zsh-abbr/commit/f8b02be1d9db6a38e899518496313041cdec04ad)) 542 | 543 | # [v3.3.1](https://github.com/olets/zsh-abbr/compare/v3.3.0...v3.3.1) (2020-05-12) 544 | 545 | Fixed a Linux error, caught a regression. 546 | 547 | ### Bug Fixes 548 | 549 | - **add:** do not wrap 'command' [[#16](https://github.com/olets/zsh-abbr/issues/16)] ([28697f3](https://github.com/olets/zsh-abbr/commit/28697f359de6382a75ae506feee6b63a01d66451)) 550 | - **help:** reinstate man fallback ([1ae0acb](https://github.com/olets/zsh-abbr/commit/1ae0acbb0aa72ea1ad83771e1fb98ae186dfd086)) 551 | 552 | ### Features 553 | 554 | - **add:** do not check for command name conflicts during init ([153b2e3](https://github.com/olets/zsh-abbr/commit/153b2e3f273612582b38f69242d6ee425649b460)) 555 | 556 | # [v3.3.0](https://github.com/olets/zsh-abbr/compare/v3.2.3...v3.3.0) (2020-05-09) 557 | 558 | Prettier output. Suppress output with `--quiet`. Don't add an abbreviation if it would interfere with an existing command. Add it anyway with `--force`. 559 | 560 | ### Features 561 | 562 | - **add:** support forcing add over system command ([57eb4a8](https://github.com/olets/zsh-abbr/commit/57eb4a8671df10f30cf24e49cad3be1156511f40)) 563 | - **add:** warn if a command exists ([0311ecf](https://github.com/olets/zsh-abbr/commit/0311ecf6db742df733f20c583d0c27afeb3ecff3)) 564 | - **dry run:** helper message more visible ([cce33fc](https://github.com/olets/zsh-abbr/commit/cce33fcf6cb37bd0f36dfdbfddb3d9f689bdbe4d)) 565 | - **import aliases:** respect type ([c000975](https://github.com/olets/zsh-abbr/commit/c000975526a798498e1b1cbdb679e1a796ed1943)) 566 | - **import git aliases:** warning gives key not full key+value ([cbe4074](https://github.com/olets/zsh-abbr/commit/cbe4074ef5c795d4d641715bf0bf5490a75087ab)) 567 | - **quiet, exit status:** output to stdout or stderr with quiet option ([e671a87](https://github.com/olets/zsh-abbr/commit/e671a8794f9b1abcd0976583c0727a8ebf18caf9)) 568 | 569 | # [v3.2.3](https://github.com/olets/zsh-abbr/compare/v3.2.2...v3.2.3) (2020-04-23) 570 | 571 | ### Bug Fixes 572 | 573 | - **import git aliases:** preserve quotation marks ([aa62bd2](https://github.com/olets/zsh-abbr/commit/aa62bd289c8b1d1e4068679f9a6d9139930a9db7)) 574 | 575 | # [3.2.2](https://github.com/olets/zsh-abbr/compare/v3.2.1...v3.2.2) (2020-04-18) 576 | 577 | ### Bug Fixes 578 | 579 | - **import aliases:** support multi-word aliases and a variety of quote levels, with [@allisio](https://github.com/allisio) [#15](https://github.com/olets/zsh-abbr/pull/15) 580 | 581 | # [3.2.1](https://github.com/olets/zsh-abbr/compare/v3.2...v3.2.1) (2020-04-18) 582 | 583 | ### Features 584 | 585 | - **ls:** wrap command to not follow potential alias [#13](https://github.com/olets/zsh-abbr/issues/13) ([a5d7c1d](https://github.com/olets/zsh-abbr/commit/a5d7c1d6f3aa0d6e4b4839c3c3c40c80b876e7a7)) 586 | 587 | # [3.2](https://github.com/olets/zsh-abbr/compare/v3.1.2...v3.2) (2020-04-07) 588 | 589 | Key changes: 590 | 591 | - Significantly faster initialization, significantly faster time per add 592 | - Linux-friendly paths (with help from @AlwinW. Thanks!) 593 | - More informative error messages 594 | - Git alias import works again 595 | - Two abbreviations are created for each Git alias, `abbr ` and `abbr -g g` 596 | - The user abbreviation file is kept alphabetized 597 | - Anything in the user abbreviation file other than abbr commands is ignored and, after the first syncing action, sanitized away 598 | - Erase does not insist that you pass the correct scope and type flags 599 | - Under the hood updates to use more idiomatic zsh 600 | 601 | ### Bug Fixes 602 | 603 | - **git aliases:** one alias per array element ([72b0bd7](https://github.com/olets/zsh-abbr/commit/72b0bd709f52f7ca831fae6a16d1a173c52310d1)) 604 | - **git aliases:** proper quoting ([44432b2](https://github.com/olets/zsh-abbr/commit/44432b26fad4c4ff3df54a245e8eb38b2d6ff01b)) 605 | - **import aliases:** point to correct command ([2fe9cbf](https://github.com/olets/zsh-abbr/commit/2fe9cbfeb23cd8c875dfc51768e4b2f5cffd8301)) 606 | - **initialization:** correct file name ([d1e29eb](https://github.com/olets/zsh-abbr/commit/d1e29eb9b9b0359d2ccddb444168760c37b05a29)) 607 | - **job:** typo missing '/' in '/tmp/zsh-abbr-jobs' ([e83f54c](https://github.com/olets/zsh-abbr/commit/e83f54caa0f4ed91908ec2ccb8ce974dfec1f22e)) 608 | - **job stack:** play nice with bad options ([c84a1bf](https://github.com/olets/zsh-abbr/commit/c84a1bf33529036257d8e3c654b95df6459d7c71)) 609 | - **quotation marks:** unsetting assoc array element requires quotes... ([22336be](https://github.com/olets/zsh-abbr/commit/22336bef67a356281e4d271b1007292a7dca3460)) 610 | - **temp files:** directory path plays nice with macos and linux ([814d121](https://github.com/olets/zsh-abbr/commit/814d121776b19e0d2e3b8c594fc9d0cd910cfc37)) 611 | - **tests:** test file is removed after tests run ([77b0753](https://github.com/olets/zsh-abbr/commit/77b0753e0a3c51bf16fafb8e77a0af9d59bb4d93)) 612 | 613 | ### Features 614 | 615 | - **add, job stack:** error messages are more informative ([3611d33](https://github.com/olets/zsh-abbr/commit/3611d33ade5516c9a2bd12aa7a2d4063631d3a1a)) 616 | - **alias, list, sync user:** alphabetize, case-insensitively ([459923c](https://github.com/olets/zsh-abbr/commit/459923cfa0cf6a48d84cd972b102e478d8cad6d0)) 617 | - **debugging:** support debug messages ([add63cb](https://github.com/olets/zsh-abbr/commit/add63cb9cf6f664dc6b9d52664c0b18c230bb57e)) 618 | - **dry run:** support env variable ([a7df1d7](https://github.com/olets/zsh-abbr/commit/a7df1d7b6fa03de51384223c95db715f8a77dd48)) 619 | - **erase:** guess unspecified type + scope; list if multiple matches ([1976228](https://github.com/olets/zsh-abbr/commit/19762280638b238666373ecb96c2e28b2d6cd04a)) 620 | - **erase, rename:** support dry run ([c18a57d](https://github.com/olets/zsh-abbr/commit/c18a57ddc3d372feab9ec3fa3db542899504eab1)) 621 | - **export aliases:** use list utility to support all quotation levels ([ababcfd](https://github.com/olets/zsh-abbr/commit/ababcfdbc824cd8f358d2d23e55be9f150a30a05)) 622 | - **fish:** no longer any need to warn about quotation marks ([a2878ea](https://github.com/olets/zsh-abbr/commit/a2878ea0e5b207f729a84ad8c58dd7b4422b0832)) 623 | - **git aliases:** add unprefixed command aliases ([4a7ab7e](https://github.com/olets/zsh-abbr/commit/4a7ab7eb4595a2f394c796acdc3578c60e10f775)) 624 | - **git aliases:** skip function aliases ([2733d6b](https://github.com/olets/zsh-abbr/commit/2733d6b5b810dc582b2f6fd1c75b11e72a6ffc9d)) 625 | - **importing:** no help instructions when skipping an existing ([b4e406c](https://github.com/olets/zsh-abbr/commit/b4e406c6e4c9732a895edd1d11e5546ce235c7c6)) 626 | - **init:** at no point are the user temp files missing... ([4603f5d](https://github.com/olets/zsh-abbr/commit/4603f5d0b1153a62f2ce7515da955d8ef3d8f239)) 627 | - **init:** only run abbr commands in user file code... ([93f2024](https://github.com/olets/zsh-abbr/commit/93f20244a7158d57d07df5c0957d9a1c79dc923c)) 628 | - **init:** remove deprecated temp files ([af1e348](https://github.com/olets/zsh-abbr/commit/af1e3483de06157e2e8046beaf8965eec632ed41)) 629 | - **init, performance:** check to see if file exists before deleting ([6cc58d3](https://github.com/olets/zsh-abbr/commit/6cc58d3537f7514a5bd0e29af1488cb986ad1d28)) 630 | - **job pop:** don't add variable to session unnecessarily ([c3af3d7](https://github.com/olets/zsh-abbr/commit/c3af3d7ba9ef10af271ef97875abc842935ebb4e)) 631 | - **job stack:** better error message ([a3980df](https://github.com/olets/zsh-abbr/commit/a3980df8bb85f6f071becc34b88a01741887ece3)) 632 | - **job stack:** ignore session-scope activity ([9cd9616](https://github.com/olets/zsh-abbr/commit/9cd9616f2d2d5cd6f8022e49b56445dede336a33)) 633 | - **job stack:** prevent possibility of collision between sessions ([099145a](https://github.com/olets/zsh-abbr/commit/099145ac1c982149942c9c19a840e030eba1bcd5)) 634 | - **job stack:** surface the current job's identity ([3257867](https://github.com/olets/zsh-abbr/commit/3257867b6af4e39407b252714773f3a648b4ac1c)) 635 | - **job stack, performance:** max one stack item per session ([f50df95](https://github.com/olets/zsh-abbr/commit/f50df958d263418c3bb7a79cba9de01ce6aefd64)) 636 | - **list:** reinstate option to list abbreviations without expansions ([99a16e2](https://github.com/olets/zsh-abbr/commit/99a16e2c187b3df4a1957961b933aff07f7b848c)) 637 | - **rename, add:** error includes type and scope ([cdf22c0](https://github.com/olets/zsh-abbr/commit/cdf22c0aa117225b80264742f4663924291fafe6)) 638 | 639 | # [3.1.2](https://github.com/olets/zsh-abbr/compare/v3.1.1...v3.1.2) (2020-03-22) 640 | 641 | ### Features 642 | 643 | - **manpage**: brew users get manpage, rest get text copy ([ed35f49](https://github.com/olets/zsh-abbr/commit/ed35f49c40e1e503881aeb8023616a3c791cb51f)) 644 | - **quotes**: quotation marks are preserved [[#10](https://github.com/olets/zsh-abbr/issues/10)] ([5a3b905](https://github.com/olets/zsh-abbr/commit/5a3b9056695fe8c852790d2cfc6f352959cbcfbf)) 645 | 646 | # [v3.1.1](https://github.com/olets/zsh-abbr/compare/v3.1.0...v3.1.1) (2020-03-07) 647 | 648 | ### Bug Fixes 649 | 650 | - **export aliases:** respect the abbreviation's type ([69fb7a3](https://github.com/olets/zsh-abbr/commit/69fb7a32416fdc5a15945850db7d985370166b44)) 651 | 652 | ### Features 653 | 654 | - **CONTRIBUTING:** new file for GitHub friendliness ([6d04986](https://github.com/olets/zsh-abbr/commit/6d04986e754a77da4ff8cb221180e76baeb49627)) 655 | 656 | # [v3.1.0](https://github.com/olets/zsh-abbr/compare/v3.0.2...v3.1.0) (2020-03-07) 657 | 658 | Look like zsh's `alias` not fish's `abbr` 659 | 660 | ### Changes 661 | 662 | - **list commands:** rename from show ([45b9a69](https://github.com/olets/zsh-abbr/commit/45b9a690a4688eb039d261fb463b1d03c00a0cbf)) 663 | - **rename:** shorthand is now capital -R and update tests ([c0cdce2](https://github.com/olets/zsh-abbr/commit/c0cdce22f06ffc282b6975893e6ae602b1b51f73)) 664 | 665 | ### Bug Fixes 666 | 667 | - **show:** listed session abbreviation commands include -S ([57f98ea](https://github.com/olets/zsh-abbr/commit/57f98eade5fa2f25c65f5df0131e5ac5d15ce1a8)) 668 | 669 | ### Features 670 | 671 | - **list commands:** support listing globals only ([7418fac](https://github.com/olets/zsh-abbr/commit/7418facc8353dabbbc3ad886f05b32ffcf499ace)) 672 | - **list commands:** support listing regulars only ([a5cab16](https://github.com/olets/zsh-abbr/commit/a5cab1620200240bc716da61f0da7f8cc12d241f)) 673 | - **list commands:** support listing users only ([9544e98](https://github.com/olets/zsh-abbr/commit/9544e98133f9b4789627ca7e08e21bed7ced1d5d)) 674 | - **list definitions:** with no arguments, behaves like zsh alias ([6c1a7a8](https://github.com/olets/zsh-abbr/commit/6c1a7a802dff9eebcdab8b0625695b85c25c2a6f)) 675 | 676 | # [v3.0.2](https://github.com/olets/zsh-abbr/compare/v3.0.1...v3.0.2) (2020-03-07) 677 | 678 | ### Bug Fixes 679 | 680 | - **expand and accept:** respect trailing whitespace ([f027565](https://github.com/olets/zsh-abbr/commit/f0275653a93579ba66caa01abbeef950bef31b39)) 681 | - **expansion:** no false positive expansions after (( ([2b53f6a](https://github.com/olets/zsh-abbr/commit/2b53f6adb262e08a45da6ec51938ad49d763c349)) 682 | 683 | # [v3.0.1](https://github.com/olets/zsh-abbr/compare/v3.0.0...v3.0.1) (2020-03-07) 684 | 685 | ### Bug Fixes 686 | 687 | - **init:** prevent collision with other initializing sessions [[#8](https://github.com/olets/zsh-abbr/issues/8)] ([f02fe24](https://github.com/olets/zsh-abbr/commit/f02fe2414b07f2a84dff887db91cd6c0465a0546)) 688 | 689 | # [v3.0.0](https://github.com/olets/zsh-abbr/compare/v2.1.3...v3.0.0) (2020-03-01) 690 | 691 | Parity with zsh alias's behavior: syntax is `abbreviation=word` instead of fish abbr-like `abbreviation word`. Distinguish between command-position abbreviations and global abbreviations. User abbreviations file is now at `${HOME}/.config/zsh/abbreviations`. Check the README documentation for `--import-fish` to move from fish abbr and zsh-abbr<\v3 to zsh-abbr v3. 692 | 693 | - **erase, rename:** support global expansions ([bab6341](https://github.com/olets/zsh-abbr/commit/bab63410770d2e1d515e78d933a91c5b681dd712)) 694 | - **expansion:** shell grammar word splitting determines current word ([a3c00f5](https://github.com/olets/zsh-abbr/commit/a3c00f58e29370ba294ed3e3d6064af0767fa1ca)) 695 | - **global abbreviations:** distinct from command abbreviations ([cd58e0d](https://github.com/olets/zsh-abbr/commit/cd58e0db949f8863393ded51eaa5a894d3e0aae7)) 696 | - **import aliases:** rename from populate ([2d4153a](https://github.com/olets/zsh-abbr/commit/2d4153a9fd7002f9710a68a16a1cf1f3ac6063ef)) 697 | - **import git aliases:** rename from git populate ([2f8e7bf](https://github.com/olets/zsh-abbr/commit/2f8e7bf6859c9562b6ec5561b668de28e649de99)) 698 | - **init,add,erase,rename:** use abbr=expansion syntax ([455dc75](https://github.com/olets/zsh-abbr/commit/455dc75784e57a9481a818cc0bf9300d2729cfeb)) 699 | - **scope:** shorthand for --session is now -S ([cf2f3b8](https://github.com/olets/zsh-abbr/commit/cf2f3b8564ce6f8295fc7396131e4fb171fbe2cf)) 700 | - **user file:** no '-a -U' ([ecb367e](https://github.com/olets/zsh-abbr/commit/ecb367e484ac3337b42cbdde9504d129aa26431e)) 701 | - **user file, exported variables:** style(env functions, env variables): more consistent naming ([2f52f9f](https://github.com/olets/zsh-abbr/commit/2f52f9f6810a8b77a9a923168d5e703e20e0d38e)) 702 | 703 | ### Features 704 | 705 | - **abbreviation, expansion:** can be just a hyphen ([be1a0c9](https://github.com/olets/zsh-abbr/commit/be1a0c914e97f60983909d64ed6515226f492dd2)) 706 | - **dry run:** support for add, import, and rename ([59cbdee](https://github.com/olets/zsh-abbr/commit/59cbdee7601be7aa80c61357eb41d3a1bf71675e)) 707 | - **import fish:** new option + documentation ([6d674bb](https://github.com/olets/zsh-abbr/commit/6d674bb738b03b057f488d6c2eb13284eaef0976)) 708 | - **list:** sections are divided with a newline ([055e378](https://github.com/olets/zsh-abbr/commit/055e3789ab7f6ffbd4b2be6963cd80eaf44f4b76)) 709 | - **storage:** globals are at top of file ([79a920b](https://github.com/olets/zsh-abbr/commit/79a920b8f9014bd1acf5657664e1a9bf74069edc)) 710 | - **sync:** use latest user globals ([44b8281](https://github.com/olets/zsh-abbr/commit/44b8281115e9c36ff145b9df94aa8a307cf71318)) 711 | - **tests:** add basic test suite ([af08727](https://github.com/olets/zsh-abbr/commit/af08727778043954b7b69000d45d517dd790cd44)) 712 | 713 | # [v2.1.3](https://github.com/olets/zsh-abbr/compare/v2.1.2...v2.1.3) (2020-02-26) 714 | 715 | ### Features 716 | 717 | - **expansion:** refresh and style autosuggestions after space ([73fc250](https://github.com/olets/zsh-abbr/commit/73fc2505042b4142c14ca20e958d4043f1cd7572)) 718 | 719 | # [v2.1.2](https://github.com/olets/zsh-abbr/compare/v2.1.1...v2.1.2) (2020-02-24) 720 | 721 | ### Bug Fixes 722 | 723 | - **expansion:** only clear autosuggestions if they are supported [[#6](https://github.com/olets/zsh-abbr/issues/6)] ([21e35b6](https://github.com/olets/zsh-abbr/commit/21e35b66c49b77e7ea72a909ebd60f06b99350b3)) 724 | 725 | ### Features 726 | 727 | - **expansion:** highlighting call is not necessary... ([5d1fde0](https://github.com/olets/zsh-abbr/commit/5d1fde0287337d8a5502dae249a309d58a0e00d9)) 728 | 729 | # [v2.1.1](https://github.com/olets/zsh-abbr/compare/v2.1.0...v2.1.1) (2020-02-22) 730 | 731 | ### Bug Fixes 732 | 733 | - **scratch file:** Linux compatibility ([#3](https://github.com/olets/zsh-abbr/pull/3) by [@ifreund](https://github.com/olets/zsh-abbr/commits?author=ifreund)) ([0e647cd](https://github.com/olets/zsh-abbr/commit/0e647cdf2d07c55b14fb98a6b3a39911c9bdb49d)) 734 | 735 | ### Features 736 | 737 | - **code of conduct:** add Contributor Covenant ([87333c5](https://github.com/olets/zsh-abbr/commit/87333c55d1246ea8075d4980cee8fb4ffbb48d11)) 738 | - **contributing:** add guidelines ([33b5fcd](https://github.com/olets/zsh-abbr/commit/33b5fcd07c137fae1a2608aa2d980cbc8f185b22)) 739 | 740 | # [v2.1.0](https://github.com/olets/zsh-abbr/compare/v2.0.0...v2.1.0) (2020-02-03) 741 | 742 | Under the hood polish; cut down on what is made available to the session; and 743 | 744 | ### Noteworthy changes 745 | 746 | - **aliases:** flag changed to --output-aliases (shorthand -o) from --create-aliases (-c) ([6b922c2](https://github.com/olets/zsh-abbr/commit/6b922c209700060253c42385e9c01795fd72c406)) 747 | - **clear globals:** flag changed to --clear-globals (shorthand -c) from --erase-all-globals (-E) ([bf90f87](https://github.com/olets/zsh-abbr/commit/bf90f878287fec6bcb397f9a33713d5ac262c9f1)) 748 | - **storage:** universals file is a list of 'abbr -a' commands ([2e191d1](https://github.com/olets/zsh-abbr/commit/2e191d15288b2e43dbaab63bde4886a6dbb43ac7)) 749 | 750 | ### Bug Fixes 751 | 752 | - **scope:** only a single scope flag is allowed ([7114a1b](https://github.com/olets/zsh-abbr/commit/7114a1b9798312db156a4c9c47f478b1776e5421)) 753 | - **scope:** no internal variables or functions bleed ([4358c2b](https://github.com/olets/zsh-abbr/commit/4358c2b417036ac69ec3bb98697491bbbc09d4c0)) 754 | 755 | ### Features 756 | 757 | - **add:** support explicit end of options with -- ([1085a29](https://github.com/olets/zsh-abbr/commit/1085a296edba45bc9435f697de19f552138fa113)) 758 | - **options:** no error on hyphen ([a25c7da](https://github.com/olets/zsh-abbr/commit/a25c7daee656cdcc86acc1edbb452ce3bea90d72)) 759 | - **rename:** suggest changing scope if abbreviation exists in the other scope but not in the specified one ([0473fb7](https://github.com/olets/zsh-abbr/commit/0473fb730b4d47ef023bf19e1dadf16ef327346a)) 760 | - **word:** delimit by '&&', '|', ';', and whitespace ([44b3740](https://github.com/olets/zsh-abbr/commit/44b37405d70ea458a92c62e679a4f788c5fcd622)) 761 | - **zinit:** verified installation documentation ([7890320](https://github.com/olets/zsh-abbr/commit/7890320a540153cfcfdc0f7ddc556cba897e7773)) 762 | 763 | # [v2.0.0](https://github.com/olets/zsh-abbr/compare/v1.2.0...v2.0.0) (2020-01-19) 764 | 765 | ### Breaking changes 766 | 767 | - **universals:** change variable name ([7ee831b](https://github.com/olets/zsh-abbr/commit/7ee831bbf4ef3629e75bf034560122609ed2b602)) 768 | 769 | ### Bug Fixes 770 | 771 | - **expansion widget:** abbreviations can end in n or t ([16feffe](https://github.com/olets/zsh-abbr/commit/16feffe826ba5b90b20bc8717a38422b5e63f4c2)) 772 | 773 | ### Features 774 | 775 | - **erase-all-globals:** new option ([f7b1bee](https://github.com/olets/zsh-abbr/commit/f7b1beeb8cd9d1e9ac675360fe9f8cd86b6edb71)) 776 | - **version:** new option ([206f521](https://github.com/olets/zsh-abbr/commit/206f521b7562ca4b91180d889a690a36c0bb2e26)) 777 | - **universals:** change default path ([c7ba374](https://github.com/olets/zsh-abbr/commit/c7ba3745e8b51dd1e70cb61031182d0334e0c811)) 778 | 779 | # [v1.2.0](https://github.com/olets/zsh-abbr/compare/v1.1.0...v1.2.0) (2020-01-12) 780 | 781 | ### Bug Fixes 782 | 783 | - **erase:** universal abbreviations can be erased ([1d67c8c](https://github.com/olets/zsh-abbr/commit/1d67c8c863449d6ad0b8328b091ce369adffcadd)) 784 | - **expansion:** when expanding with spacebar, append a space ([e5b4696](https://github.com/olets/zsh-abbr/commit/e5b469639610516b974518243f2095156f31867b)) 785 | - **git-populate:** synax error ([e78eb2b](https://github.com/olets/zsh-abbr/commit/e78eb2b1c87cced3a001033c94c4ca4039eb2a93)) 786 | - **rename:** correct syntax for removing an abbreviation ([f99834a](https://github.com/olets/zsh-abbr/commit/f99834a0b6dda311ce0e1b5ae56839f0f1ef0a24)) 787 | - **synching:** correct paths ([6cc7e0c](https://github.com/olets/zsh-abbr/commit/6cc7e0c33e968b15cfbbbaea89a6a36b5d1f0f43), [aa80f5d](https://github.com/olets/zsh-abbr/commit/aa80f5d86e820a150eda5de420a219fa5954db11)) 788 | 789 | ### Features 790 | 791 | - **arguments:** support long options ([9386436](https://github.com/olets/zsh-abbr/commit/9386436a4ee0e8a1529ef45b4973f504850dd4c6)) 792 | - **bindings:** add variable for opting out of defaults ([7edd67e](https://github.com/olets/zsh-abbr/commit/7edd67ea710dcfc93fd9c2e816249b9ecfb9055d)) 793 | - **create-aliases:** new option ([35ace71](https://github.com/olets/zsh-abbr/commit/35ace71d5d2baa1f65dc4e2e3f49e922f531da17)) 794 | - **expansion:** plays nice with zsh-autosuggestions ([e19a0a1](https://github.com/olets/zsh-abbr/commit/e19a0a10a85aacc69891e63d09a1b82602b3e8df)) 795 | - **expansion:** support expand-on-enter (has suggestions bug) ([f8356be](https://github.com/olets/zsh-abbr/commit/f8356be04bc9fdff44549b9ec54f7cf20a94fb1b)) 796 | - **expansion:** support zsh-syntax-highlighting ([cff6dc0](https://github.com/olets/zsh-abbr/commit/cff6dc009cf2d4688509360f4914366420169924)) 797 | - **rename:** error if old doesn't exist or new already exists ([a030670](https://github.com/olets/zsh-abbr/commit/a0306700c79b486cda6780dbfbcd33b4799bf223)) 798 | 799 | # [v1.1.0](https://github.com/olets/zsh-abbr/compare/v1.0.0...v1.1.0) (2019-01-26) 800 | 801 | Bug fixes and 802 | 803 | ### Features 804 | 805 | - **git-populate:** new option ([28ea419](https://github.com/olets/zsh-abbr/commit/28ea4198ba28a8f764e4685d233cc9b10268623f)) 806 | - **populate:** option to create abbreviations from aliases ([fbbf9a6](https://github.com/olets/zsh-abbr/commit/fbbf9a6753bf3aa31625d006c4992a7f0cb21386)) 807 | 808 | # [v1.0.0](https://github.com/olets/zsh-abbr/compare/initial...v1.0.0) (2019-01-26) 809 | 810 | Feature parity with fish's abbr 811 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 7 | 8 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 9 | 10 | ## Our Standards 11 | 12 | Examples of behavior that contributes to a positive environment for our community include: 13 | 14 | * Demonstrating empathy and kindness toward other people 15 | * Being respectful of differing opinions, viewpoints, and experiences 16 | * Giving and gracefully accepting constructive feedback 17 | * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 18 | * Focusing on what is best not just for us as individuals, but for the overall community 19 | 20 | Examples of unacceptable behavior include: 21 | 22 | * The use of sexualized language or imagery, and sexual attention or 23 | advances of any kind 24 | * Trolling, insulting or derogatory comments, and personal or political attacks 25 | * Public or private harassment 26 | * Publishing others' private information, such as a physical or email 27 | address, without their explicit permission 28 | * Other conduct which could reasonably be considered inappropriate in a 29 | professional setting 30 | 31 | ## Enforcement Responsibilities 32 | 33 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. 34 | 35 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. 36 | 37 | ## Scope 38 | 39 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 40 | 41 | ## Enforcement 42 | 43 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement (Henry Bley-Vroman) at olets@olets.dev. Complaints about the community leaders may be reported to Ben Tinsley at benj.tinsley@gmail.com. All complaints will be reviewed and investigated promptly and fairly. 44 | 45 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 46 | 47 | ## Enforcement Guidelines 48 | 49 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 50 | 51 | ### 1. Correction 52 | 53 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 54 | 55 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. 56 | 57 | ### 2. Warning 58 | 59 | **Community Impact**: A violation through a single incident or series of actions. 60 | 61 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. 62 | 63 | ### 3. Temporary Ban 64 | 65 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 66 | 67 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. 68 | 69 | ### 4. Permanent Ban 70 | 71 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. 72 | 73 | **Consequence**: A permanent ban from any sort of public interaction within the community. 74 | 75 | ## Attribution 76 | 77 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, 78 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 79 | 80 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 81 | 82 | [homepage]: https://www.contributor-covenant.org 83 | 84 | For answers to common questions about this code of conduct, see the FAQ at 85 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. 86 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for your interest. Contributions are welcome! 4 | 5 | > Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. 6 | 7 | Check the [Issues](https://github.com/olets/zsh-abbr/issues) to see if your topic has been discussed before or if it is being worked on. You may also want to check the roadmap (see above). Discussing in an Issue before opening a Pull Request means future contributors only have to search in one place. 8 | 9 | This project includes a Git [submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules). Passing `--recurse-submodules` when `git clone`ing is recommended. 10 | 11 | This project loosely follows the [Angular commit message conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit). This helps with searchability and with the changelog, which is generated automatically and touched up by hand only if necessary. Use the commit message format `(): `, where `` is **feat** for new or changed behavior, **fix** for fixes, **docs** for documentation, **style** for under the hood changes related to for example zshisms, **refactor** for other refactors, **test** for tests, or **chore** chore for general maintenance (this will be used primarily by maintainers not contributors, for example for version bumps). `` is more loosely defined. Look at the [commit history](https://github.com/olets/zsh-abbr/commits/master) for ideas. 12 | 13 | The test suite uses [zsh-test-runner](https://github.com/olets/zsh-test-runner). Run with test suite with 14 | 15 | ```shell 16 | . ./tests/abbr.ztr 17 | ``` 18 | 19 | ## Maintainers 20 | 21 | To cut a new release: 22 | 23 | 1. Check out the `main` branch. 24 | 1. Update all instances of the version number in [`zsh-abbr.zsh`](zsh-abbr.zsh). 25 | 1. Update all instances of the release date in [`zsh-abbr.zsh`](zsh-abbr.zsh). 26 | 1. Update all instances of the version number in [`man/man1/abbr.1`](man/man1/abbr.1). 27 | 1. Update all instances of the release date in [`man/man1/abbr.1`](man/man1/abbr.1). 28 | 1. Update all instances of the version number in [`completions/_abbr`](completions/_abbr). 29 | 1. Run `bin/changelog`. 30 | 1. Update the first line of [`CHANGELOG.md`](CHANGELOG.md): add the new version number twice: 31 | ``` 32 | # [](…vPrevious...v) (…) 33 | ``` 34 | 1. Commit `CHANGELOG.md`, `zsh-abbr.zsh`, `man/man1/abbr.1`, and `completions/_abbr`. 35 | ```shell 36 | git commit -i CHANGELOG.md completions/_abbr man/man1/abbr.1 zsh-abbr.zsh -m "feat(release): bump to v%ABBR_CURSOR%, update changelog" 37 | ``` 38 | 1. Create a signed commit with the version number, prefixed with `v`. 39 | ```shell 40 | git tag -s v%ABBR_CURSOR% -m v%ABBR_CURSOR% 41 | ``` 42 | 1. If possible to fast-forward `next` to `main`, do so. If it isn't, rebase/merge/etc as needed to have `next` fork off the tip of `main`. 43 | 1. Fast-forward the major-version branch (e.g. branch `v5`) to `main`. 44 | 1. Push `main`, the tag, `next`, the major version branch, and any branches rewritten in the process of bringing `next` up to `main`. 45 | 1. In GitHub, publish a new release. https://github.com/olets/zsh-abbr/releases/new. A GitHub Actions workflow will automatically update the Homebrew formula. 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | zsh-abbr Copyright (2020-present) (Henry Bley-Vroman)(“Licensor”) 2 | 3 | The following summary is informational purposes only, is not exhaustive, and does not 4 | form part of the license. 5 | 6 | This license is the text of Hippocratic License 3.0 7 | (https://firstdonoharm.dev/build?modules=eco,extr,media,mil,sv,usta) followed by 8 | the text of CC BY-NC-SA 4.0 9 | (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). The combination was 10 | not put together by a lawyer and is not affiliated with Creative Commons or the 11 | Organization for Ethical Source; it should be understood in the spirit of 12 | "CC BY-NC-SA 4.0 with Hippocratic License v3 ethical requirements". 13 | 14 | [The following is quoted from https://creativecommons.org/licenses/by-nc-sa/4.0, 15 | except where otherwise noted] 16 | 17 | You are free to 18 | 19 | - Share — copy and redistribute the material in any medium or format 20 | - Adapt — remix, transform, and build upon the material 21 | 22 | Under the following terms 23 | 24 | - Attribution — You must give appropriate credit, provide a link to the license, 25 | and indicate if changes were made. You may do so in any reasonable manner, but 26 | not in any way that suggests the licensor endorses you or your use. 27 | - Non-commercial — You may not use the material for commercial purposes. 28 | - [Hippocratic License 3.0 not https://creativecommons.org/licenses/by-nc-sa/4.0] 29 | Ethics - You must abide by the ethical standards specified in the Hippocratic License 3 30 | with Ecocide, Extractive Industries, US Tariff Act, Mass Surveillance, Military 31 | Activities, and Media modules. 32 | - Preserve terms — If you remix, transform, or build upon the material, you must 33 | distribute your contributions under the same license as the original. 34 | - No additional restrictions — You may not apply legal terms or technological measures 35 | that legally restrict others from doing anything the license permits. 36 | 37 | [End quote] 38 | 39 | ---------------------------------------------------------------- 40 | 41 | **HIPPOCRATIC LICENSE** 42 | 43 | Version 3.0, October 2021 44 | 45 | https://firstdonoharm.dev/version/3/0/eco-extr-media-mil-sv-usta.txt 46 | 47 | TERMS AND CONDITIONS 48 | 49 | TERMS AND CONDITIONS FOR USE, COPY, MODIFICATION, PREPARATION OF DERIVATIVE 50 | WORK, REPRODUCTION, AND DISTRIBUTION: 51 | 52 | 1. DEFINITIONS: 53 | 54 | This section defines certain terms used throughout this license agreement. 55 | 56 | 1.1. “License” means the terms and conditions, as stated herein, for use, copy, 57 | modification, preparation of derivative work, reproduction, and distribution of 58 | Software (as defined below). 59 | 60 | 1.2. “Licensor” means the copyright and/or patent owner or entity authorized by 61 | the copyright and/or patent owner that is granting the License. 62 | 63 | 1.3. “Licensee” means the individual or entity exercising permissions granted by 64 | this License, including the use, copy, modification, preparation of derivative 65 | work, reproduction, and distribution of Software (as defined below). 66 | 67 | 1.4. “Software” means any copyrighted work, including but not limited to 68 | software code, authored by Licensor and made available under this License. 69 | 70 | 1.5. “Supply Chain” means the sequence of processes involved in the production 71 | and/or distribution of a commodity, good, or service offered by the Licensee. 72 | 73 | 1.6. “Supply Chain Impacted Party” or “Supply Chain Impacted Parties” means any 74 | person(s) directly impacted by any of Licensee’s Supply Chain, including the 75 | practices of all persons or entities within the Supply Chain prior to a good or 76 | service reaching the Licensee. 77 | 78 | 1.7. “Duty of Care” is defined by its use in tort law, delict law, and/or 79 | similar bodies of law closely related to tort and/or delict law, including 80 | without limitation, a requirement to act with the watchfulness, attention, 81 | caution, and prudence that a reasonable person in the same or similar 82 | circumstances would use towards any Supply Chain Impacted Party. 83 | 84 | 1.8. “Worker” is defined to include any and all permanent, temporary, and agency 85 | workers, as well as piece-rate, salaried, hourly paid, legal young (minors), 86 | part-time, night, and migrant workers. 87 | 88 | 2. INTELLECTUAL PROPERTY GRANTS: 89 | 90 | This section identifies intellectual property rights granted to a Licensee. 91 | 92 | 2.1. Grant of Copyright License: Subject to the terms and conditions of this 93 | License, Licensor hereby grants to Licensee a worldwide, non-exclusive, 94 | no-charge, royalty-free copyright license to use, copy, modify, prepare 95 | derivative work, reproduce, or distribute the Software, Licensor authored 96 | modified software, or other work derived from the Software. 97 | 98 | 2.2. Grant of Patent License: Subject to the terms and conditions of this 99 | License, Licensor hereby grants Licensee a worldwide, non-exclusive, no-charge, 100 | royalty-free patent license to make, have made, use, offer to sell, sell, 101 | import, and otherwise transfer Software. 102 | 103 | 3. ETHICAL STANDARDS: 104 | 105 | This section lists conditions the Licensee must comply with in order to have 106 | rights under this License. 107 | 108 | The rights granted to the Licensee by this License are expressly made subject to 109 | the Licensee’s ongoing compliance with the following conditions: 110 | 111 | * 3.1. The Licensee SHALL NOT, whether directly or indirectly, through agents 112 | or assigns: 113 | 114 | * 3.1.1. Infringe upon any person’s right to life or security of person, 115 | engage in extrajudicial killings, or commit murder, without lawful cause 116 | (See Article 3, United Nations Universal Declaration of Human Rights; 117 | Article 6, International Covenant on Civil and Political Rights) 118 | 119 | * 3.1.2. Hold any person in slavery, servitude, or forced labor (See Article 120 | 4, United Nations Universal Declaration of Human Rights; Article 8, 121 | International Covenant on Civil and Political Rights); 122 | 123 | * 3.1.3. Contribute to the institution of slavery, slave trading, forced 124 | labor, or unlawful child labor (See Article 4, United Nations Universal 125 | Declaration of Human Rights; Article 8, International Covenant on Civil and 126 | Political Rights); 127 | 128 | * 3.1.4. Torture or subject any person to cruel, inhumane, or degrading 129 | treatment or punishment (See Article 5, United Nations Universal 130 | Declaration of Human Rights; Article 7, International Covenant on Civil and 131 | Political Rights); 132 | 133 | * 3.1.5. Discriminate on the basis of sex, gender, sexual orientation, race, 134 | ethnicity, nationality, religion, caste, age, medical disability or 135 | impairment, and/or any other like circumstances (See Article 7, United 136 | Nations Universal Declaration of Human Rights; Article 2, International 137 | Covenant on Economic, Social and Cultural Rights; Article 26, International 138 | Covenant on Civil and Political Rights); 139 | 140 | * 3.1.6. Prevent any person from exercising his/her/their right to seek an 141 | effective remedy by a competent court or national tribunal (including 142 | domestic judicial systems, international courts, arbitration bodies, and 143 | other adjudicating bodies) for actions violating the fundamental rights 144 | granted to him/her/them by applicable constitutions, applicable laws, or by 145 | this License (See Article 8, United Nations Universal Declaration of Human 146 | Rights; Articles 9 and 14, International Covenant on Civil and Political 147 | Rights); 148 | 149 | * 3.1.7. Subject any person to arbitrary arrest, detention, or exile (See 150 | Article 9, United Nations Universal Declaration of Human Rights; Article 9, 151 | International Covenant on Civil and Political Rights); 152 | 153 | * 3.1.8. Subject any person to arbitrary interference with a person’s 154 | privacy, family, home, or correspondence without the express written 155 | consent of the person (See Article 12, United Nations Universal Declaration 156 | of Human Rights; Article 17, International Covenant on Civil and Political 157 | Rights); 158 | 159 | * 3.1.9. Arbitrarily deprive any person of his/her/their property (See 160 | Article 17, United Nations Universal Declaration of Human Rights); 161 | 162 | * 3.1.10. Forcibly remove indigenous peoples from their lands or territories 163 | or take any action with the aim or effect of dispossessing indigenous 164 | peoples from their lands, territories, or resources, including without 165 | limitation the intellectual property or traditional knowledge of indigenous 166 | peoples, without the free, prior, and informed consent of indigenous 167 | peoples concerned (See Articles 8 and 10, United Nations Declaration on the 168 | Rights of Indigenous Peoples); 169 | 170 | * 3.1.11. Ecocide: Commit ecocide: 171 | 172 | * 3.1.11.1. For the purpose of this section, “ecocide” means unlawful or 173 | wanton acts committed with knowledge that there is a substantial 174 | likelihood of severe and either widespread or long-term damage to the 175 | environment being caused by those acts; 176 | 177 | * 3.1.11.2. For the purpose of further defining ecocide and the terms 178 | contained in the previous paragraph: 179 | 180 | * 3.1.11.2.1. “Wanton” means with reckless disregard for damage which 181 | would be clearly excessive in relation to the social and economic 182 | benefits anticipated; 183 | 184 | * 3.1.11.2.2. “Severe” means damage which involves very serious adverse 185 | changes, disruption, or harm to any element of the environment, 186 | including grave impacts on human life or natural, cultural, or 187 | economic resources; 188 | 189 | * 3.1.11.2.3. “Widespread” means damage which extends beyond a limited 190 | geographic area, crosses state boundaries, or is suffered by an entire 191 | ecosystem or species or a large number of human beings; 192 | 193 | * 3.1.11.2.4. “Long-term” means damage which is irreversible or which 194 | cannot be redressed through natural recovery within a reasonable 195 | period of time; and 196 | 197 | * 3.1.11.2.5. “Environment” means the earth, its biosphere, cryosphere, 198 | lithosphere, hydrosphere, and atmosphere, as well as outer space 199 | 200 | (See Section II, Independent Expert Panel for the Legal Definition of 201 | Ecocide, Stop Ecocide Foundation and the Promise Institute for Human 202 | Rights at UCLA School of Law, June 2021); 203 | 204 | * 3.1.12. Extractive Industries: Be an individual or entity, or a 205 | representative, agent, affiliate, successor, attorney, or assign of an 206 | individual or entity, that engages in fossil fuel or mineral exploration, 207 | extraction, development, or sale; 208 | 209 | * 3.1.13. US Tariff Act: Be an individual or entity: 210 | 211 | * 3.1.13.1. which U.S. Customs and Border Protection (CBP) has currently 212 | issued a Withhold Release Order (WRO) or finding against based on 213 | reasonable suspicion of forced labor; or 214 | 215 | * 3.1.13.2. that is a representative, agent, affiliate, successor, 216 | attorney, or assign of an individual or entity that does business with 217 | an individual or entity which currently has a WRO or finding from CBP 218 | issued against it based on reasonable suspicion of forced labor; 219 | 220 | * 3.1.14. Mass Surveillance: Be a government agency or multinational 221 | corporation, or a representative, agent, affiliate, successor, attorney, 222 | or assign of a government or multinational corporation, which participates 223 | in mass surveillance programs; 224 | 225 | * 3.1.15. Military Activities: Be an entity or a representative, agent, 226 | affiliate, successor, attorney, or assign of an entity which conducts 227 | military activities; 228 | 229 | * 3.1.16. Media: Be an individual or entity, or a or a representative, 230 | agent, affiliate, successor, attorney, or assign of an individual or 231 | entity, that broadcasts messages promoting killing, torture, or other 232 | forms of extreme violence; 233 | 234 | * 3.1.17. Interfere with Workers' free exercise of the right to organize and 235 | associate (See Article 20, United Nations Universal Declaration of Human 236 | Rights; C087 - Freedom of Association and Protection of the Right to 237 | Organise Convention, 1948 (No. 87), International Labour Organization; 238 | Article 8, International Covenant on Economic, Social and Cultural Rights); 239 | and 240 | 241 | * 3.1.18. Harm the environment in a manner inconsistent with local, state, 242 | national, or international law. 243 | 244 | * 3.2. The Licensee SHALL: 245 | 246 | * 3.2.1. Provide equal pay for equal work where the performance of such work 247 | requires equal skill, effort, and responsibility, and which are performed 248 | under similar working conditions, except where such payment is made 249 | pursuant to: 250 | 251 | * 3.2.1.1. A seniority system; 252 | 253 | * 3.2.1.2. A merit system; 254 | 255 | * 3.2.1.3. A system which measures earnings by quantity or quality of 256 | production; or 257 | 258 | * 3.2.1.4. A differential based on any other factor other than sex, gender, 259 | sexual orientation, race, ethnicity, nationality, religion, caste, age, 260 | medical disability or impairment, and/or any other like circumstances 261 | (See 29 U.S.C.A. § 206(d)(1); Article 23, United Nations Universal 262 | Declaration of Human Rights; Article 7, International Covenant on 263 | Economic, Social and Cultural Rights; Article 26, International Covenant 264 | on Civil and Political Rights); and 265 | 266 | * 3.2.2. Allow for reasonable limitation of working hours and periodic 267 | holidays with pay (See Article 24, United Nations Universal Declaration of 268 | Human Rights; Article 7, International Covenant on Economic, Social and 269 | Cultural Rights). 270 | 271 | 4. SUPPLY CHAIN IMPACTED PARTIES: 272 | 273 | This section identifies additional individuals or entities that a Licensee could 274 | harm as a result of violating the Ethical Standards section, the condition that 275 | the Licensee must voluntarily accept a Duty of Care for those individuals or 276 | entities, and the right to a private right of action that those individuals or 277 | entities possess as a result of violations of the Ethical Standards section. 278 | 279 | 4.1. In addition to the above Ethical Standards, Licensee voluntarily accepts a 280 | Duty of Care for Supply Chain Impacted Parties of this License, including 281 | individuals and communities impacted by violations of the Ethical Standards. The 282 | Duty of Care is breached when a provision within the Ethical Standards section 283 | is violated by a Licensee, one of its successors or assigns, or by an individual 284 | or entity that exists within the Supply Chain prior to a good or service 285 | reaching the Licensee. 286 | 287 | 4.2. Breaches of the Duty of Care, as stated within this section, shall create a 288 | private right of action, allowing any Supply Chain Impacted Party harmed by the 289 | Licensee to take legal action against the Licensee in accordance with applicable 290 | negligence laws, whether they be in tort law, delict law, and/or similar bodies 291 | of law closely related to tort and/or delict law, regardless if Licensee is 292 | directly responsible for the harms suffered by a Supply Chain Impacted Party. 293 | Nothing in this section shall be interpreted to include acts committed by 294 | individuals outside of the scope of his/her/their employment. 295 | 296 | 5. NOTICE: This section explains when a Licensee must notify others of the 297 | License. 298 | 299 | 5.1. Distribution of Notice: Licensee must ensure that everyone who receives a 300 | copy of or uses any part of Software from Licensee, with or without changes, 301 | also receives the License and the copyright notice included with Software (and 302 | if included by the Licensor, patent, trademark, and attribution notice). 303 | Licensee must ensure that License is prominently displayed so that any 304 | individual or entity seeking to download, copy, use, or otherwise receive any 305 | part of Software from Licensee is notified of this License and its terms and 306 | conditions. Licensee must cause any modified versions of the Software to carry 307 | prominent notices stating that Licensee changed the Software. 308 | 309 | 5.2. Modified Software: Licensee is free to create modifications of the Software 310 | and distribute only the modified portion created by Licensee, however, any 311 | derivative work stemming from the Software or its code must be distributed 312 | pursuant to this License, including this Notice provision. 313 | 314 | 5.3. Recipients as Licensees: Any individual or entity that uses, copies, 315 | modifies, reproduces, distributes, or prepares derivative work based upon the 316 | Software, all or part of the Software’s code, or a derivative work developed by 317 | using the Software, including a portion of its code, is a Licensee as defined 318 | above and is subject to the terms and conditions of this License. 319 | 320 | 6. REPRESENTATIONS AND WARRANTIES: 321 | 322 | 6.1. Disclaimer of Warranty: TO THE FULL EXTENT ALLOWED BY LAW, THIS SOFTWARE 323 | COMES “AS IS,” WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED, AND LICENSOR SHALL NOT 324 | BE LIABLE TO ANY PERSON OR ENTITY FOR ANY DAMAGES OR OTHER LIABILITY ARISING 325 | FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THIS LICENSE, UNDER ANY 326 | LEGAL CLAIM. 327 | 328 | 6.2. Limitation of Liability: LICENSEE SHALL HOLD LICENSOR HARMLESS AGAINST ANY 329 | AND ALL CLAIMS, DEBTS, DUES, LIABILITIES, LIENS, CAUSES OF ACTION, DEMANDS, 330 | OBLIGATIONS, DISPUTES, DAMAGES, LOSSES, EXPENSES, ATTORNEYS' FEES, COSTS, 331 | LIABILITIES, AND ALL OTHER CLAIMS OF EVERY KIND AND NATURE WHATSOEVER, WHETHER 332 | KNOWN OR UNKNOWN, ANTICIPATED OR UNANTICIPATED, FORESEEN OR UNFORESEEN, ACCRUED 333 | OR UNACCRUED, DISCLOSED OR UNDISCLOSED, ARISING OUT OF OR RELATING TO LICENSEE’S 334 | USE OF THE SOFTWARE. NOTHING IN THIS SECTION SHOULD BE INTERPRETED TO REQUIRE 335 | LICENSEE TO INDEMNIFY LICENSOR, NOR REQUIRE LICENSOR TO INDEMNIFY LICENSEE. 336 | 337 | 7. TERMINATION 338 | 339 | 7.1. Violations of Ethical Standards or Breaching Duty of Care: If Licensee 340 | violates the Ethical Standards section or Licensee, or any other person or 341 | entity within the Supply Chain prior to a good or service reaching the Licensee, 342 | breaches its Duty of Care to Supply Chain Impacted Parties, Licensee must remedy 343 | the violation or harm caused by Licensee within 30 days of being notified of the 344 | violation or harm. If Licensee fails to remedy the violation or harm within 30 345 | days, all rights in the Software granted to Licensee by License will be null and 346 | void as between Licensor and Licensee. 347 | 348 | 7.2. Failure of Notice: If any person or entity notifies Licensee in writing 349 | that Licensee has not complied with the Notice section of this License, Licensee 350 | can keep this License by taking all practical steps to comply within 30 days 351 | after the notice of noncompliance. If Licensee does not do so, Licensee’s 352 | License (and all rights licensed hereunder) will end immediately. 353 | 354 | 7.3. Judicial Findings: In the event Licensee is found by a civil, criminal, 355 | administrative, or other court of competent jurisdiction, or some other 356 | adjudicating body with legal authority, to have committed actions which are in 357 | violation of the Ethical Standards or Supply Chain Impacted Party sections of 358 | this License, all rights granted to Licensee by this License will terminate 359 | immediately. 360 | 361 | 7.4. Patent Litigation: If Licensee institutes patent litigation against any 362 | entity (including a cross-claim or counterclaim in a suit) alleging that the 363 | Software, all or part of the Software’s code, or a derivative work developed 364 | using the Software, including a portion of its code, constitutes direct or 365 | contributory patent infringement, then any patent license, along with all other 366 | rights, granted to Licensee under this License will terminate as of the date 367 | such litigation is filed. 368 | 369 | 7.5. Additional Remedies: Termination of the License by failing to remedy harms 370 | in no way prevents Licensor or Supply Chain Impacted Party from seeking 371 | appropriate remedies at law or in equity. 372 | 373 | 8. MISCELLANEOUS: 374 | 375 | 8.1. Conditions: Sections 3, 4.1, 5.1, 5.2, 7.1, 7.2, 7.3, and 7.4 are 376 | conditions of the rights granted to Licensee in the License. 377 | 378 | 8.2. Equitable Relief: Licensor and any Supply Chain Impacted Party shall be 379 | entitled to equitable relief, including injunctive relief or specific 380 | performance of the terms hereof, in addition to any other remedy to which they 381 | are entitled at law or in equity. 382 | 383 | 8.3. Severability: If any term or provision of this License is determined to be 384 | invalid, illegal, or unenforceable by a court of competent jurisdiction, any 385 | such determination of invalidity, illegality, or unenforceability shall not 386 | affect any other term or provision of this License or invalidate or render 387 | unenforceable such term or provision in any other jurisdiction. If the 388 | determination of invalidity, illegality, or unenforceability by a court of 389 | competent jurisdiction pertains to the terms or provisions contained in the 390 | Ethical Standards section of this License, all rights in the Software granted to 391 | Licensee shall be deemed null and void as between Licensor and Licensee. 392 | 393 | 8.4. Section Titles: Section titles are solely written for organizational 394 | purposes and should not be used to interpret the language within each section. 395 | 396 | 8.5. Citations: Citations are solely written to provide context for the source 397 | of the provisions in the Ethical Standards. 398 | 399 | 8.6. Section Summaries: Some sections have a brief italicized description which 400 | is provided for the sole purpose of briefly describing the section and should 401 | not be used to interpret the terms of the License. 402 | 403 | 8.7. Entire License: This is the entire License between the Licensor and 404 | Licensee with respect to the claims released herein and that the consideration 405 | stated herein is the only consideration or compensation to be paid or exchanged 406 | between them for this License. This License cannot be modified or amended except 407 | in a writing signed by Licensor and Licensee. 408 | 409 | 8.8. Successors and Assigns: This License shall be binding upon and inure to the 410 | benefit of the Licensor’s and Licensee’s respective heirs, successors, and 411 | assigns. 412 | 413 | 414 | ---------------------------------------------------------------- 415 | 416 | **Attribution-NonCommercial-ShareAlike 4.0 International** 417 | 418 | Creative Commons Corporation ("Creative Commons") is not a law firm and 419 | does not provide legal services or legal advice. Distribution of 420 | Creative Commons public licenses does not create a lawyer-client or 421 | other relationship. Creative Commons makes its licenses and related 422 | information available on an "as-is" basis. Creative Commons gives no 423 | warranties regarding its licenses, any material licensed under their 424 | terms and conditions, or any related information. Creative Commons 425 | disclaims all liability for damages resulting from their use to the 426 | fullest extent possible. 427 | 428 | Using Creative Commons Public Licenses 429 | 430 | Creative Commons public licenses provide a standard set of terms and 431 | conditions that creators and other rights holders may use to share 432 | original works of authorship and other material subject to copyright 433 | and certain other rights specified in the public license below. The 434 | following considerations are for informational purposes only, are not 435 | exhaustive, and do not form part of our licenses. 436 | 437 | Considerations for licensors: Our public licenses are 438 | intended for use by those authorized to give the public 439 | permission to use material in ways otherwise restricted by 440 | copyright and certain other rights. Our licenses are 441 | irrevocable. Licensors should read and understand the terms 442 | and conditions of the license they choose before applying it. 443 | Licensors should also secure all rights necessary before 444 | applying our licenses so that the public can reuse the 445 | material as expected. Licensors should clearly mark any 446 | material not subject to the license. This includes other CC- 447 | licensed material, or material used under an exception or 448 | limitation to copyright. More considerations for licensors: 449 | wiki.creativecommons.org/Considerations_for_licensors 450 | 451 | Considerations for the public: By using one of our public 452 | licenses, a licensor grants the public permission to use the 453 | licensed material under specified terms and conditions. If 454 | the licensor's permission is not necessary for any reason--for 455 | example, because of any applicable exception or limitation to 456 | copyright--then that use is not regulated by the license. Our 457 | licenses grant only permissions under copyright and certain 458 | other rights that a licensor has authority to grant. Use of 459 | the licensed material may still be restricted for other 460 | reasons, including because others have copyright or other 461 | rights in the material. A licensor may make special requests, 462 | such as asking that all changes be marked or described. 463 | Although not required by our licenses, you are encouraged to 464 | respect those requests where reasonable. More considerations 465 | for the public: 466 | wiki.creativecommons.org/Considerations_for_licensees 467 | 468 | ======================================================================= 469 | 470 | Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International 471 | Public License 472 | 473 | By exercising the Licensed Rights (defined below), You accept and agree 474 | to be bound by the terms and conditions of this Creative Commons 475 | Attribution-NonCommercial-ShareAlike 4.0 International Public License 476 | ("Public License"). To the extent this Public License may be 477 | interpreted as a contract, You are granted the Licensed Rights in 478 | consideration of Your acceptance of these terms and conditions, and the 479 | Licensor grants You such rights in consideration of benefits the 480 | Licensor receives from making the Licensed Material available under 481 | these terms and conditions. 482 | 483 | 484 | Section 1 -- Definitions. 485 | 486 | a. Adapted Material means material subject to Copyright and Similar 487 | Rights that is derived from or based upon the Licensed Material 488 | and in which the Licensed Material is translated, altered, 489 | arranged, transformed, or otherwise modified in a manner requiring 490 | permission under the Copyright and Similar Rights held by the 491 | Licensor. For purposes of this Public License, where the Licensed 492 | Material is a musical work, performance, or sound recording, 493 | Adapted Material is always produced where the Licensed Material is 494 | synched in timed relation with a moving image. 495 | 496 | b. Adapter's License means the license You apply to Your Copyright 497 | and Similar Rights in Your contributions to Adapted Material in 498 | accordance with the terms and conditions of this Public License. 499 | 500 | c. BY-NC-SA Compatible License means a license listed at 501 | creativecommons.org/compatiblelicenses, approved by Creative 502 | Commons as essentially the equivalent of this Public License. 503 | 504 | d. Copyright and Similar Rights means copyright and/or similar rights 505 | closely related to copyright including, without limitation, 506 | performance, broadcast, sound recording, and Sui Generis Database 507 | Rights, without regard to how the rights are labeled or 508 | categorized. For purposes of this Public License, the rights 509 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 510 | Rights. 511 | 512 | e. Effective Technological Measures means those measures that, in the 513 | absence of proper authority, may not be circumvented under laws 514 | fulfilling obligations under Article 11 of the WIPO Copyright 515 | Treaty adopted on December 20, 1996, and/or similar international 516 | agreements. 517 | 518 | f. Exceptions and Limitations means fair use, fair dealing, and/or 519 | any other exception or limitation to Copyright and Similar Rights 520 | that applies to Your use of the Licensed Material. 521 | 522 | g. License Elements means the license attributes listed in the name 523 | of a Creative Commons Public License. The License Elements of this 524 | Public License are Attribution, NonCommercial, and ShareAlike. 525 | 526 | h. Licensed Material means the artistic or literary work, database, 527 | or other material to which the Licensor applied this Public 528 | License. 529 | 530 | i. Licensed Rights means the rights granted to You subject to the 531 | terms and conditions of this Public License, which are limited to 532 | all Copyright and Similar Rights that apply to Your use of the 533 | Licensed Material and that the Licensor has authority to license. 534 | 535 | j. Licensor means the individual(s) or entity(ies) granting rights 536 | under this Public License. 537 | 538 | k. NonCommercial means not primarily intended for or directed towards 539 | commercial advantage or monetary compensation. For purposes of 540 | this Public License, the exchange of the Licensed Material for 541 | other material subject to Copyright and Similar Rights by digital 542 | file-sharing or similar means is NonCommercial provided there is 543 | no payment of monetary compensation in connection with the 544 | exchange. 545 | 546 | l. Share means to provide material to the public by any means or 547 | process that requires permission under the Licensed Rights, such 548 | as reproduction, public display, public performance, distribution, 549 | dissemination, communication, or importation, and to make material 550 | available to the public including in ways that members of the 551 | public may access the material from a place and at a time 552 | individually chosen by them. 553 | 554 | m. Sui Generis Database Rights means rights other than copyright 555 | resulting from Directive 96/9/EC of the European Parliament and of 556 | the Council of 11 March 1996 on the legal protection of databases, 557 | as amended and/or succeeded, as well as other essentially 558 | equivalent rights anywhere in the world. 559 | 560 | n. You means the individual or entity exercising the Licensed Rights 561 | under this Public License. Your has a corresponding meaning. 562 | 563 | 564 | Section 2 -- Scope. 565 | 566 | a. License grant. 567 | 568 | 1. Subject to the terms and conditions of this Public License, 569 | the Licensor hereby grants You a worldwide, royalty-free, 570 | non-sublicensable, non-exclusive, irrevocable license to 571 | exercise the Licensed Rights in the Licensed Material to: 572 | 573 | a. reproduce and Share the Licensed Material, in whole or 574 | in part, for NonCommercial purposes only; and 575 | 576 | b. produce, reproduce, and Share Adapted Material for 577 | NonCommercial purposes only. 578 | 579 | 2. Exceptions and Limitations. For the avoidance of doubt, where 580 | Exceptions and Limitations apply to Your use, this Public 581 | License does not apply, and You do not need to comply with 582 | its terms and conditions. 583 | 584 | 3. Term. The term of this Public License is specified in Section 585 | 6(a). 586 | 587 | 4. Media and formats; technical modifications allowed. The 588 | Licensor authorizes You to exercise the Licensed Rights in 589 | all media and formats whether now known or hereafter created, 590 | and to make technical modifications necessary to do so. The 591 | Licensor waives and/or agrees not to assert any right or 592 | authority to forbid You from making technical modifications 593 | necessary to exercise the Licensed Rights, including 594 | technical modifications necessary to circumvent Effective 595 | Technological Measures. For purposes of this Public License, 596 | simply making modifications authorized by this Section 2(a) 597 | (4) never produces Adapted Material. 598 | 599 | 5. Downstream recipients. 600 | 601 | a. Offer from the Licensor -- Licensed Material. Every 602 | recipient of the Licensed Material automatically 603 | receives an offer from the Licensor to exercise the 604 | Licensed Rights under the terms and conditions of this 605 | Public License. 606 | 607 | b. Additional offer from the Licensor -- Adapted Material. 608 | Every recipient of Adapted Material from You 609 | automatically receives an offer from the Licensor to 610 | exercise the Licensed Rights in the Adapted Material 611 | under the conditions of the Adapter's License You apply. 612 | 613 | c. No downstream restrictions. You may not offer or impose 614 | any additional or different terms or conditions on, or 615 | apply any Effective Technological Measures to, the 616 | Licensed Material if doing so restricts exercise of the 617 | Licensed Rights by any recipient of the Licensed 618 | Material. 619 | 620 | 6. No endorsement. Nothing in this Public License constitutes or 621 | may be construed as permission to assert or imply that You 622 | are, or that Your use of the Licensed Material is, connected 623 | with, or sponsored, endorsed, or granted official status by, 624 | the Licensor or others designated to receive attribution as 625 | provided in Section 3(a)(1)(A)(i). 626 | 627 | b. Other rights. 628 | 629 | 1. Moral rights, such as the right of integrity, are not 630 | licensed under this Public License, nor are publicity, 631 | privacy, and/or other similar personality rights; however, to 632 | the extent possible, the Licensor waives and/or agrees not to 633 | assert any such rights held by the Licensor to the limited 634 | extent necessary to allow You to exercise the Licensed 635 | Rights, but not otherwise. 636 | 637 | 2. Patent and trademark rights are not licensed under this 638 | Public License. 639 | 640 | 3. To the extent possible, the Licensor waives any right to 641 | collect royalties from You for the exercise of the Licensed 642 | Rights, whether directly or through a collecting society 643 | under any voluntary or waivable statutory or compulsory 644 | licensing scheme. In all other cases the Licensor expressly 645 | reserves any right to collect such royalties, including when 646 | the Licensed Material is used other than for NonCommercial 647 | purposes. 648 | 649 | 650 | Section 3 -- License Conditions. 651 | 652 | Your exercise of the Licensed Rights is expressly made subject to the 653 | following conditions. 654 | 655 | a. Attribution. 656 | 657 | 1. If You Share the Licensed Material (including in modified 658 | form), You must: 659 | 660 | a. retain the following if it is supplied by the Licensor 661 | with the Licensed Material: 662 | 663 | i. identification of the creator(s) of the Licensed 664 | Material and any others designated to receive 665 | attribution, in any reasonable manner requested by 666 | the Licensor (including by pseudonym if 667 | designated); 668 | 669 | ii. a copyright notice; 670 | 671 | iii. a notice that refers to this Public License; 672 | 673 | iv. a notice that refers to the disclaimer of 674 | warranties; 675 | 676 | v. a URI or hyperlink to the Licensed Material to the 677 | extent reasonably practicable; 678 | 679 | b. indicate if You modified the Licensed Material and 680 | retain an indication of any previous modifications; and 681 | 682 | c. indicate the Licensed Material is licensed under this 683 | Public License, and include the text of, or the URI or 684 | hyperlink to, this Public License. 685 | 686 | 2. You may satisfy the conditions in Section 3(a)(1) in any 687 | reasonable manner based on the medium, means, and context in 688 | which You Share the Licensed Material. For example, it may be 689 | reasonable to satisfy the conditions by providing a URI or 690 | hyperlink to a resource that includes the required 691 | information. 692 | 3. If requested by the Licensor, You must remove any of the 693 | information required by Section 3(a)(1)(A) to the extent 694 | reasonably practicable. 695 | 696 | b. ShareAlike. 697 | 698 | In addition to the conditions in Section 3(a), if You Share 699 | Adapted Material You produce, the following conditions also apply. 700 | 701 | 1. The Adapter's License You apply must be a Creative Commons 702 | license with the same License Elements, this version or 703 | later, or a BY-NC-SA Compatible License. 704 | 705 | 2. You must include the text of, or the URI or hyperlink to, the 706 | Adapter's License You apply. You may satisfy this condition 707 | in any reasonable manner based on the medium, means, and 708 | context in which You Share Adapted Material. 709 | 710 | 3. You may not offer or impose any additional or different terms 711 | or conditions on, or apply any Effective Technological 712 | Measures to, Adapted Material that restrict exercise of the 713 | rights granted under the Adapter's License You apply. 714 | 715 | 716 | Section 4 -- Sui Generis Database Rights. 717 | 718 | Where the Licensed Rights include Sui Generis Database Rights that 719 | apply to Your use of the Licensed Material: 720 | 721 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 722 | to extract, reuse, reproduce, and Share all or a substantial 723 | portion of the contents of the database for NonCommercial purposes 724 | only; 725 | 726 | b. if You include all or a substantial portion of the database 727 | contents in a database in which You have Sui Generis Database 728 | Rights, then the database in which You have Sui Generis Database 729 | Rights (but not its individual contents) is Adapted Material, 730 | including for purposes of Section 3(b); and 731 | 732 | c. You must comply with the conditions in Section 3(a) if You Share 733 | all or a substantial portion of the contents of the database. 734 | 735 | For the avoidance of doubt, this Section 4 supplements and does not 736 | replace Your obligations under this Public License where the Licensed 737 | Rights include other Copyright and Similar Rights. 738 | 739 | 740 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 741 | 742 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 743 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 744 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 745 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 746 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 747 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 748 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 749 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 750 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 751 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 752 | 753 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 754 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 755 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 756 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 757 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 758 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 759 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 760 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 761 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 762 | 763 | c. The disclaimer of warranties and limitation of liability provided 764 | above shall be interpreted in a manner that, to the extent 765 | possible, most closely approximates an absolute disclaimer and 766 | waiver of all liability. 767 | 768 | 769 | Section 6 -- Term and Termination. 770 | 771 | a. This Public License applies for the term of the Copyright and 772 | Similar Rights licensed here. However, if You fail to comply with 773 | this Public License, then Your rights under this Public License 774 | terminate automatically. 775 | 776 | b. Where Your right to use the Licensed Material has terminated under 777 | Section 6(a), it reinstates: 778 | 779 | 1. automatically as of the date the violation is cured, provided 780 | it is cured within 30 days of Your discovery of the 781 | violation; or 782 | 783 | 2. upon express reinstatement by the Licensor. 784 | 785 | For the avoidance of doubt, this Section 6(b) does not affect any 786 | right the Licensor may have to seek remedies for Your violations 787 | of this Public License. 788 | 789 | c. For the avoidance of doubt, the Licensor may also offer the 790 | Licensed Material under separate terms or conditions or stop 791 | distributing the Licensed Material at any time; however, doing so 792 | will not terminate this Public License. 793 | 794 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 795 | License. 796 | 797 | 798 | Section 7 -- Other Terms and Conditions. 799 | 800 | a. The Licensor shall not be bound by any additional or different 801 | terms or conditions communicated by You unless expressly agreed. 802 | 803 | b. Any arrangements, understandings, or agreements regarding the 804 | Licensed Material not stated herein are separate from and 805 | independent of the terms and conditions of this Public License. 806 | 807 | 808 | Section 8 -- Interpretation. 809 | 810 | a. For the avoidance of doubt, this Public License does not, and 811 | shall not be interpreted to, reduce, limit, restrict, or impose 812 | conditions on any use of the Licensed Material that could lawfully 813 | be made without permission under this Public License. 814 | 815 | b. To the extent possible, if any provision of this Public License is 816 | deemed unenforceable, it shall be automatically reformed to the 817 | minimum extent necessary to make it enforceable. If the provision 818 | cannot be reformed, it shall be severed from this Public License 819 | without affecting the enforceability of the remaining terms and 820 | conditions. 821 | 822 | c. No term or condition of this Public License will be waived and no 823 | failure to comply consented to unless expressly agreed to by the 824 | Licensor. 825 | 826 | d. Nothing in this Public License constitutes or may be interpreted 827 | as a limitation upon, or waiver of, any privileges and immunities 828 | that apply to the Licensor or You, including from the legal 829 | processes of any jurisdiction or authority. 830 | 831 | ======================================================================= 832 | 833 | Creative Commons is not a party to its public 834 | licenses. Notwithstanding, Creative Commons may elect to apply one of 835 | its public licenses to material it publishes and in those instances 836 | will be considered the “Licensor.” The text of the Creative Commons 837 | public licenses is dedicated to the public domain under the CC0 Public 838 | Domain Dedication. Except for the limited purpose of indicating that 839 | material is shared under a Creative Commons public license or as 840 | otherwise permitted by the Creative Commons policies published at 841 | creativecommons.org/policies, Creative Commons does not authorize the 842 | use of the trademark "Creative Commons" or any other trademark or logo 843 | of Creative Commons without its prior written consent including, 844 | without limitation, in connection with any unauthorized modifications 845 | to any of its public licenses or any other arrangements, 846 | understandings, or agreements concerning use of licensed material. For 847 | the avoidance of doubt, this paragraph does not form part of the 848 | public licenses. 849 | 850 | Creative Commons may be contacted at creativecommons.org. 851 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zsh-abbr ![GitHub release (latest by date)](https://img.shields.io/github/v/release/olets/zsh-abbr?include_prereleases&label=pre-release) ![GitHub commits since latest release](https://img.shields.io/github/commits-since/olets/zsh-abbr/latest?include_prereleases) 2 | 3 | **zsh-abbr** is the zsh manager for **auto-expanding abbreviations** - text that when written in a terminal is replaced with other (typically longer) text. Inspired by fish shell. 4 | 5 | > [!IMPORTANT] 6 | > v6 was released on Nov 12 2024, with breaking changes. If you do advanced configuration, read [the v5.x -> v6.x migration guide](https://v6.zsh-abbr.olets.dev/migrating-between-versions.html#upgrading-from-v5-to-v6) and/or read about [pinning v5.x](https://v5.zsh-abbr.olets.dev/installation.html). 7 | 8 | For example, abbreviate `git checkout` as `co` (or even `c` or anything else). Type `co`Space and the `co` **turns into** `git checkout`. Abbreviate `git checkout main` as `cm`. Type `cm`Enter and the `cm` **turns into and runs** `git checkout main`. Don't want an abbreviation to expand? Use CtrlSpace instead of Space, and `;`Enter instead of Enter. 9 | 10 | Why? Like aliases, abbreviations **save keystrokes**. Unlike aliases, abbreviations can leave you with a **transparently understandable command history** ready for using on a different computer or sharing with a colleague. And where aliases can let you forget the full command, abbreviations may **help you learn** the full command even as you type the shortened version. 11 | 12 | Like **zsh's `alias`**, zsh-abbr supports **"regular"** (i.e. command-position) and **"global"** (anywhere on the line) abbreviations. It also supports **interactive creation** of persistent abbreviations which are immediately available in all terminal sessions. Abbreviations automatically **sync to a file**, ready for your dotfile management. 13 | 14 | Run `abbr help` for documentation; if the package is installed with Homebrew, `man abbr` is also available. 15 | 16 | ## Documentation 17 | 18 | 📖 See the guide at https://zsh-abbr.olets.dev/ 19 | 20 | v5 is a major release. It makes changes that will require some users to update their configurations. Details are in the [migration guide](https://zsh-abbr.olets.dev/migrating-between-versions). 21 | 22 | ## Changelog 23 | 24 | See the [CHANGELOG](CHANGELOG.md) file. 25 | 26 | ## Roadmap 27 | 28 | See the [ROADMAP](ROADMAP.md) file. 29 | 30 | ## Contributing 31 | 32 | _Looking for the documentation site's source? See _ 33 | 34 | Thanks for your interest. Contributions are welcome! 35 | 36 | > Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. 37 | 38 | Check the [Issues](https://github.com/olets/zsh-abbr/issues) to see if your topic has been discussed before or if it is being worked on. You may also want to check the roadmap (see above). 39 | 40 | Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. 41 | 42 | The test suite uses [zsh-test-runner](https://github.com/olets/zsh-test-runner) v2.x. See [tests/README.md](tests/README.md) for instructions on running the test suite. 43 | 44 | ### Sponsoring 45 | 46 | Love zsh-abbr? I'm happy to be able to provide it for free. If you are moved to turn appreciation into action, I invite you to make a donation to one of the organizations listed below (to be listed as a financial contributor, send me a receipt via email or [Reddit DM](https://www.reddit.com/user/olets)). Thank you! 47 | 48 | - [O‘ahu Water Protectors](https://oahuwaterprotectors.org/) a coalition of organizers and concerned community members fighting for safe, clean water on Oʻahu. Currently focused on the Red Hill Bulk Fuel Storage Facility crisis (see Sierra Club of Hawaii's [explainer](https://sierraclubhawaii.org/redhill)). 49 | - [Hoʻoulu ʻĀina](https://hoouluaina.org/) is a 100-acre nature preserve nestled in the back of Kalihi valley on the island of Oʻahu which seeks to provide people of our ahupuaʻa and beyond the freedom to make connections and build meaningful relationships with the ʻāina, each other and ourselves. 50 | - [Ol Pejeta Conservancy](https://www.olpejetaconservancy.org/) are caretakers of the land, safeguarding endangered species and ensuring the openness and accessibility of conservation for all. They empower their people to think the same way and embrace new approaches to conservation, and provide natural wilderness experiences, backed up by scientifically credible conservation and genuine interactions with wildlife. 51 | - [Southern Utah Wilderness Alliance (SUWA)](https://suwa.org/) the only non-partisan, non-profit organization working full time to defend Utah’s redrock wilderness from oil and gas development, unnecessary road construction, rampant off-road vehicle use, and other threats to Utah’s wilderness-quality lands. 52 | 53 | ## Community 54 | 55 | This project uses all-contributors to recognize its community. The key to the emojis is on the [all-contributors website](https://allcontributors.org/docs/en/emoji-key). 56 | 57 | The following are some of the people who have contributed. All zsh-abbr repo committers are listed [here](https://github.com/olets/zsh-abbr/contributors), and all zsh-abbr docs committers are listed [here](https://github.com/olets/zsh-abbr-v4-docs/graphs/contributors) (v4) and [here](https://github.com/olets/zsh-abbr-v5-docs/graphs/contributors) (v5). Other people have reported bugs and typos, helped debug, helped test features and bug fixes. The project wouldn't be where it is without them. 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
Akinori MUSHA
Akinori MUSHA

💻
Alwin Wang
Alwin Wang

💻
Daniel Berninghoff
Daniel Berninghoff

💻
Farid NL
Farid NL

💻
Henry Bley-Vroman
Henry Bley-Vroman

📖 🎨 💬 🔧 💡 🤔 🚇 ⚠️ 🚧 👀
Henré Botha
Henré Botha

💻 🤔 💵 📖 🐛
Icy-Thought
Icy-Thought

📦
Ihor Urazov
Ihor Urazov

📖
Lucas Larson
Lucas Larson

🐛
Stefan Hojer
Stefan Hojer

💻 🐛 📓
Teppei Shimaji
Teppei Shimaji

💻 📖
81 | 82 | 83 | 84 | 85 | 86 | 87 | ## License 88 | 89 | zsh-abbr by Henry Bley-Vroman is licensed under a license which is the unmodified text of CC BY-NC-SA 4.0 and the unmodified text of a Hippocratic License 3. It is not affiliated with Creative Commons or the Organization for Ethical Source. 90 | 91 | Human-readable summary of (and not a substitute for) the [LICENSE](LICENSE) file: 92 | 93 | You are free to 94 | 95 | - Share — copy and redistribute the material in any medium or format 96 | - Adapt — remix, transform, and build upon the material 97 | 98 | Under the following terms 99 | 100 | - Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 101 | - Non-commercial — You may not use the material for commercial purposes. 102 | - Ethics - You must abide by the ethical standards specified in the Hippocratic License 3 with Ecocide, Extractive Industries, US Tariff Act, Mass Surveillance, Military Activities, and Media modules. 103 | - Preserve terms — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. 104 | - No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. 105 | 106 | ## Acknowledgments 107 | 108 | - The human-readable license summary is based on https://creativecommons.org/licenses/by-nc-sa/4.0. The ethics point was added. 109 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | # ROADMAP 2 | 3 | Key: 4 | 5 | - [x] checked is completed 6 | - [ ] unchecked is to-do 7 | 8 | --- 9 | 10 | _Currently considered feature complete._ 11 | 12 | ## Next breaking release 13 | 14 | ## Maybe? 15 | 16 | - [ ] Tests for list commands 17 | - [ ] Test for export command 18 | - [ ] Test for XDG_CONFIG_HOME support 19 | 20 | ## Maybe maybe? 21 | 22 | - [x] command completion 23 | - [ ] command highlighting 24 | -------------------------------------------------------------------------------- /bin/changelog: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | [[ -n $('builtin' 'command' -v conventional-changelog) ]] || { 5 | printf "Requires conventional-changelog\nhttps://github.com/conventional-changelog/conventional-changelog\n" 6 | return 1 7 | } 8 | 9 | 'builtin' 'command' conventional-changelog -i CHANGELOG.md -s -p angular 10 | } 11 | 12 | main 13 | -------------------------------------------------------------------------------- /community.md: -------------------------------------------------------------------------------- 1 | --- 2 | editLink: false 3 | --- 4 | 9 | 10 | 11 | # Community 12 | 13 | This project uses all-contributors to recognize its community. The key to the emojis is on the [all-contributors website](https://allcontributors.org/docs/en/emoji-key). 14 | 15 | The following are some of the people who have contributed. All zsh-abbr repo committers are listed [here](https://github.com/olets/zsh-abbr/contributors), and all zsh-abbr docs committers are listed [here](https://github.com/olets/zsh-abbr-v4-docs/graphs/contributors) (v4) and [here](https://github.com/olets/zsh-abbr-v5-docs/graphs/contributors) (v5). Other people have reported bugs and typos, helped debug, helped test features and bug fixes. The project wouldn't be where it is without them. 16 | 17 | -------------------------------------------------------------------------------- /completions/_abbr: -------------------------------------------------------------------------------- 1 | #compdef abbr 2 | # ------------------------------------------------------------------------------ 3 | # Completion script for zsh-abbr 4 | # 5 | # https://github.com/olets/zsh-abbr 6 | # v6.2.1 7 | # Copyright (c) 2019-present Henry Bley-Vroman 8 | # 9 | # Licensed under the same license as zsh-abbr. See zsh-abbr's LICENSE file 10 | # 11 | # ------------------------------------------------------------------------------ 12 | 13 | main() { 14 | local line 15 | local state 16 | 17 | local -i ret 18 | 19 | ret=1 20 | 21 | _arguments -C \ 22 | "1: :->cmds" \ 23 | "*:: :->args" && ret=0 24 | 25 | case $state in 26 | cmds) 27 | # grouping syntax requires at least one comma. 28 | # completion system will display `{one}` as literal '{one}', 29 | # but `{one,}` as `one` 30 | _values "abbr command" \ 31 | {add,a}"[Add a new abbreviation.]" \ 32 | {clear-session,c}"[Erase all session abbreviations.]" \ 33 | {erase,e}"[Erase an abbreviation.]" \ 34 | {expand,x}"[Output the ABBREVIATION's EXPANSION.]" \ 35 | {export-aliases,}"[Export abbreviations as alias commands.]" \ 36 | {git,g}"[Add a regular abbreviation, the expansion of which is prefixed with git; and add a global abbreviation, the abbreviation and expansion of which are prefixed with git.]" \ 37 | {help,--help}"[Show the manpage.]" \ 38 | {import-aliases,}"[Add regular abbreviations for every regular alias in the session, and global abbreviations for every global alias in the session.]" \ 39 | {import-fish,}"[Import fish abbr-syntax abbreviations.]" \ 40 | {import-git-aliases,}"[Add regular abbreviations for every Git alias in the current session. The EXPANSION is prefixed with git\[Space\].]" \ 41 | {list,}"[List the abbreviations with their expansions.]" \ 42 | {list-abbreviations,l}"[List the abbreviations only.]" \ 43 | {list-commands,}"[List as commands suitable for export.]" \ 44 | {profile,}"[Log profile information for debugging.]" \ 45 | {rename,R}"[Rename an abbreviation.]" \ 46 | {version,--version,-v}"[Show the current version.]" 47 | ret=0 48 | ;; 49 | args) 50 | case $line[1] in 51 | a|\ 52 | add) 53 | _arguments \ 54 | "(--dry-run)--dry-run[see what would result, without making any actual changes]" \ 55 | "(-f --force)"{-f,--force}"[ignore warnings]" \ 56 | "(-g --global -r --regular)"{-g,--global}"[expand everywhere]" \ 57 | "(-g --global -r --regular)"{-r,--regular}"[expand at the start of the line]" \ 58 | "(-q --quiet -qq --quieter)"{-q,--quiet}"[silence success output]" \ 59 | "(-q --quiet -qq --quieter)"{-qq,--quieter}"[silence success output and warnings]" \ 60 | "(-S --session -U --user)"{-S,--session}"[available in this session]" \ 61 | "(-S --session -U --user)"{-U,--user}"[available in all sessions]" 62 | ret=0 63 | ;; 64 | e|\ 65 | erase) 66 | _arguments \ 67 | "(--dry-run)--dry-run[see what would result, without making any actual changes]" \ 68 | "(-g --global -r --regular)"{-g,--global}"[expand everywhere]" \ 69 | "(-g --global -r --regular)"{-r,--regular}"[expand at the start of the line]" \ 70 | "(-q --quiet)"{-q,--quiet}"[silence success output]" \ 71 | "(-S --session -U --user)"{-S,--session}"[available in this session]" \ 72 | "(-S --session -U --user)"{-U,--user}"[available in all sessions]" \ 73 | "1: :__abbr_describe_abbreviations" 74 | ret=0 75 | ;; 76 | export-aliases|\ 77 | list|\ 78 | l|\ 79 | list-abbreviations|\ 80 | L|\ 81 | list-commands) 82 | _arguments \ 83 | "(-g --global -r --regular)"{-g,--global}"[expand everywhere]" \ 84 | "(-g --global -r --regular)"{-r,--regular}"[expand at the start of the line]" \ 85 | "(-S --session -U --user)"{-S,--session}"[available in this session]" \ 86 | "(-S --session -U --user)"{-U,--user}"[available in all sessions]" 87 | ret=0 88 | ;; 89 | git) 90 | # does not support -g/--global/-r/--regular 91 | _arguments \ 92 | "(--dry-run)--dry-run[see what would result, without making any actual changes]" \ 93 | "(-f --force)"{-f,--force}"[ignore warnings]" \ 94 | "(-q --quiet -qq --quieter)"{-q,--quiet}"[silence success output]" \ 95 | "(-q --quiet -qq --quieter)"{-qq,--quieter}"[silence success output and warnings]" \ 96 | "(-S --session -U --user)"{-S,--session}"[available in this session]" \ 97 | "(-S --session -U --user)"{-U,--user}"[available in all sessions]" 98 | ret=0 99 | ;; 100 | import-aliases) 101 | _arguments \ 102 | "(--dry-run)--dry-run[see what would result, without making any actual changes]" \ 103 | "(-f --force)"{-f,--force}"[ignore warnings]" \ 104 | "(-g --global -r --regular)"{-g,--global}"[expand everywhere]" \ 105 | "(-g --global -r --regular)"{-r,--regular}"[expand at the start of the line]" \ 106 | "(-q --quiet -qq --quieter)"{-q,--quiet}"[silence success output]" \ 107 | "(-q --quiet -qq --quieter)"{-qq,--quieter}"[silence success output and warnings]" \ 108 | "(-S --session -U --user)"{-S,--session}"[available in this session]" \ 109 | "(-S --session -U --user)"{-U,--user}"[available in all sessions]" 110 | ret=0 111 | ;; 112 | import-fish) 113 | # does not support -g/--global/-r/--regular 114 | _arguments \ 115 | "(--dry-run)--dry-run[see what would result, without making any actual changes]" \ 116 | "(-f --force)"{-f,--force}"[ignore warnings]" \ 117 | "(-q --quiet -qq --quieter)"{-q,--quiet}"[silence success output]" \ 118 | "(-q --quiet -qq --quieter)"{-qq,--quieter}"[silence success output and warnings]" \ 119 | "(-S --session -U --user)"{-S,--session}"[available in this session]" \ 120 | "(-S --session -U --user)"{-U,--user}"[available in all sessions]" 121 | ret=0 122 | ;; 123 | import-git-aliases) 124 | _arguments \ 125 | "(--dry-run)--dry-run[see what would result, without making any actual changes]" \ 126 | "(--file)--file[path to a Git config file]:filename:_files -/" \ 127 | "(--prefix)--prefix[prefix added to the ABBREVIATIONs]" \ 128 | "(-f --force)"{-f,--force}"[ignore warnings]" \ 129 | "(-g --global -r --regular)"{-g,--global}"[expand everywhere]" \ 130 | "(-g --global -r --regular)"{-r,--regular}"[expand at the start of the line]" \ 131 | "(-q --quiet -qq --quieter)"{-q,--quiet}"[silence success output]" \ 132 | "(-q --quiet -qq --quieter)"{-qq,--quieter}"[silence success output and warnings]" \ 133 | "(-S --session -U --user)"{-S,--session}"[available in this session]" \ 134 | "(-S --session -U --user)"{-U,--user}"[available in all sessions]" 135 | ret=0 136 | ;; 137 | R|\ 138 | rename) 139 | _arguments \ 140 | "(--dry-run)--dry-run[see what would result, without making any actual changes]" \ 141 | "(-f --force)"{-f,--force}"[ignore warnings]" \ 142 | "(-g --global -r --regular)"{-g,--global}"[expand everywhere]" \ 143 | "(-g --global -r --regular)"{-r,--regular}"[expand at the start of the line]" \ 144 | "(-q --quiet -qq --quieter)"{-q,--quiet}"[silence success output]" \ 145 | "(-q --quiet -qq --quieter)"{-qq,--quieter}"[silence success output and warnings]" \ 146 | "(-S --session -U --user)"{-S,--session}"[available in this session]" \ 147 | "(-S --session -U --user)"{-U,--user}"[available in all sessions]" \ 148 | "1: :__abbr_describe_abbreviations" 149 | ret=0 150 | ;; 151 | esac 152 | ;; 153 | esac 154 | 155 | return ret 156 | } 157 | 158 | (( $+functions[__abbr_describe_abbreviations] )) || __abbr_describe_abbreviations() { 159 | local abbreviations_set 160 | local -a abbreviations_sets 161 | local abbreviation 162 | local expansion 163 | local completion_and_description 164 | local -a completions_and_descriptions 165 | local scope 166 | local type 167 | 168 | if (( $words[(Ie)-U] || $words[(Ie)--user] )); then 169 | scope="user" 170 | elif (( $words[(Ie)-S] || $words[(Ie)--session] )); then 171 | scope="session" 172 | fi 173 | 174 | if (( $words[(Ie)-r] || $words[(Ie)--regular] )); then 175 | type="regular" 176 | elif (( $words[(Ie)-g] || $words[(Ie)--global] )); then 177 | type="global" 178 | fi 179 | 180 | # DUPE (nearly) completions/_abbr's __abbr_describe_abbreviations, zsh-abbr.zsh's _abbr:util_list 181 | 182 | if [[ $scope != 'session' ]]; then 183 | if [[ $type != 'regular' ]]; then 184 | abbreviations_sets+=( ABBR_GLOBAL_USER_ABBREVIATIONS ) 185 | fi 186 | 187 | if [[ $type != 'global' ]]; then 188 | abbreviations_sets+=( ABBR_REGULAR_USER_ABBREVIATIONS ) 189 | fi 190 | fi 191 | 192 | if [[ $scope != 'user' ]]; then 193 | if [[ $type != 'regular' ]]; then 194 | abbreviations_sets+=( ABBR_GLOBAL_SESSION_ABBREVIATIONS ) 195 | fi 196 | 197 | if [[ $type != 'global' ]]; then 198 | abbreviations_sets+=( ABBR_REGULAR_SESSION_ABBREVIATIONS ) 199 | fi 200 | fi 201 | 202 | for abbreviations_set in $abbreviations_sets; do 203 | for abbreviation in ${(iko)${(P)abbreviations_set}}; do 204 | expansion=${${(P)abbreviations_set}[$abbreviation]} 205 | completion_and_description=${${(Q)abbreviation}//:/\\:}:${(Q)expansion} 206 | completions_and_descriptions+=( $completion_and_description ) 207 | done 208 | done 209 | 210 | # DUPE end 211 | 212 | # "_describe [-12JVx] [ -oO | -t tag ] descr name1 [ name2 ] [ opt ... ] 213 | # The descr is taken as a string to display above the matches if the format style for the descriptions tag is set. This is followed by one or two names of arrays followed by options to pass to compadd. The array name1 contains the possible completions with their descriptions in the form ‘completion:description’. Any literal colons in completion must be quoted with a backslash. If a name2 is given, it should have the same number of elements as name1; in this case the corresponding elements are added as possible completions instead of the completion strings from name1. The completion list will retain the descriptions from name1. Finally, a set of completion options can appear. 214 | # https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Completion-Functions 215 | # Here, `_describe descr name1` 216 | _describe "abbr completions and descriptions" completions_and_descriptions 217 | } 218 | 219 | main 220 | 221 | # vim: ft=zsh 222 | -------------------------------------------------------------------------------- /docs/releasing.md: -------------------------------------------------------------------------------- 1 | # Releasing 2 | 3 | The process for cutting new releases. 4 | 5 | 1. Checkout `main` 6 | 1. Run 7 | ```shell 8 | conventional-changelog -p angular -i CHANGELOG.md -s 9 | ``` 10 | Requires [conventional-changelog-cli](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli) 11 | 1. Update `./man/man1/abbr.1`: bump date and version at top. 12 | 1. Update `./zsh-abbr.zsh`: bump version at top, and date and version in `_abbr()` 13 | 1. Commit with message (replacing `` with the version) 14 | ``` 15 | chore(bump): bump to v, update changelog 16 | ``` 17 | 1. Tag the release. Run (replacing `` with the tag, `v`-prefixed semver) 18 | ```shell 19 | git tag 20 | ``` 21 | 1. Update overall trunk branches. Run 22 | ```shell 23 | git push 24 | git merge main 25 | git push 26 | ``` 27 | 1. Update the appropriate version trunk branch. Run for example (before the v5 release) 28 | ```shell 29 | git checkout v4 30 | git merge main 31 | git push 32 | ``` 33 | 1. If appropriate, update other version trunks. 34 | - If the change is made in v4, run 35 | ```shell 36 | git checkout v5 37 | git merge --no-ff v4 38 | git checkout --ours . 39 | git checkout v4 -- 40 | # manually copy over v4 CHANGELOG change into v5, marking it as "From v4.…" 41 | git commit 42 | git push 43 | ``` 44 | 1. Push the tag. Run (replacing `` with the tag) 45 | ```shell 46 | git push origin 47 | ``` 48 | 1. On GitHub cut a new release at the tag. Use the form of existing release notes, replacing the version number, SHA, and CHANGELOG URL. The appropriate formula will automatically update. 49 | 1. If the change is to a prerelease, update the Homebrew formula's HEAD branch. Run 50 | ```shell 51 | git checkout next 52 | git merge # e.g. git merge v5 53 | ``` 54 | -------------------------------------------------------------------------------- /man/man1/abbr.1: -------------------------------------------------------------------------------- 1 | .TH "ZSH-ABBR" 1 "February 21 2025" "abbr 6.2.1" "User Commands" 2 | .SH NAME 3 | zsh\-abbr \- manage zsh abbreviations 4 | .SH SYNOPSIS 5 | 6 | For full manual including options, see https://zsh-abbr.olets.dev/ 7 | 8 | \fBabbr\fR (\fBadd\fR | \fBa\fR) [\fIscope\fR] [(\fI\-force\fR | \fI\-\-force\fR)] <\fIabbreviation\fR>=<\fIexpansion\fR> 9 | 10 | \fBabbr\fR (\fBgit\fR | \fBg\fR) [\fIscope\fR] [(\fI\-force\fR | \fI\-\-force\fR)] <\fIabbreviation\fR>=<\fIexpansion\fR> 11 | 12 | \fBabbr\fR (\fBclear\-session\fR | \fBc\fR) 13 | 14 | \fBabbr\fR (\fBerase\fR | \fBe\fR) [\fIscope\fR] <\fIabbreviation\fR> 15 | 16 | \fBabbr\fR (\fBexpand\fR | \fBx\fR) <\fIabbreviation\fR> 17 | 18 | \fBabbr\fR (\fBexport\-aliases\fR | \fB\-o\fR) <\fIscope\fI> 19 | 20 | \fBabbr import\-aliases\fR [\fIscope\fR] 21 | 22 | \fBabbr import\-fish\fR <\fIfile\fR> 23 | 24 | \fBabbr import\-git\-aliases\fR 25 | 26 | \fBabbr list\fR 27 | 28 | \fBabbr (list\-abbreviations\fR | \fBl\fR) 29 | 30 | \fBabbr\fR (\fBlist\-commands\fR | \fBL\fR) 31 | 32 | \fBabbr\fR (\fBrename\fR | \fBR\fR) [\fIscope\fR] [(\fI\-force\fR | \fI\-\-force\fR)] <\fIold_abbreviation\fR> <\fInew_abbreviation\fR> 33 | 34 | \fBabbr load\fR 35 | 36 | \fBabbr\fR (\fBhelp | \-\-help\fR | \fB\-h\fR) 37 | 38 | \fBabbr\fR (\fBversion | \-\-version\fR | \fB\-v) 39 | 40 | \fBabbr profile\fR 41 | 42 | .SH DESCRIPTION 43 | \fBabbr\fR manages abbreviations \- user\-defined words that are replaced with longer phrases after they are entered. 44 | 45 | For example, a frequently\-run command like git checkout can be abbreviated to gco. After entering gco and pressing [\fBSpace\fR], the full text git checkout will appear in the command line. 46 | 47 | To prevent expansion, press [\fBCTRL\-SPACE\fR] in place of [\fBSPACE\fR]. 48 | 49 | \fBabbr-load\fR triggers a reload of the user abbreviations files. This also runs automatically before each of the above commands. 50 | 51 | .SH Commands 52 | The following commands are available: 53 | 54 | .IP \(bu 55 | \fBadd <\fIabbreviation\fR>=<\fIexpansion\fR> or \fBa\fR <\fIabbreviation\fR>=<\fIexpansion\fR> 56 | 57 | Adds a new abbreviation, causing <\fIabbreviation\fR> to be expanded as <\fIexpansion\fR>. 58 | 59 | Will error rather than overwrite an existing abbreviation. 60 | 61 | Will warn if the abbreviation would replace an existing command. To add in spite of the warning, use [(\fI\-force\fR | \fI\-\-force\fR)]. 62 | 63 | May be multiple words. Quote or escape word delimiters. 64 | 65 | .IP \(bu 66 | \fBgit <\fIabbreviation\fR>=<\fIexpansion\fR> or \fBg\fR <\fIabbreviation\fR>=<\fIexpansion\fR> 67 | 68 | Shorthand for 69 | 70 | add abbreviation="git expansion" 71 | 72 | add "git abbreviation"="git expansion" 73 | 74 | .IP \(bu 75 | \fBclear\-session\fR or \fBc\fR 76 | 77 | Erases all session abbreviations. 78 | 79 | .IP \(bu 80 | \fBerase <\fIabbreviation\fR> or \fBe\fR <\fIabbreviation\fR> 81 | 82 | Erases the abbreviation <\fIabbreviation\fR> . 83 | 84 | .IP \(bu 85 | \fBexpand <\fIabbreviation\fR> or \fBx <\fIabbreviation\fR> 86 | 87 | Returns the <\fIexpansion\fR> of the abbreviation <\fIabbreviation\fR>. 88 | 89 | .IP \(bu 90 | \fBexport\-aliases\fR [<\fIdestination\fR>] 91 | 92 | Exports a list of alias command for user abbreviations, suitable for pasting or piping to whereever you keep aliases. 93 | 94 | .IP \(bu 95 | \fBimport\-aliases\fR 96 | 97 | Adds abbreviations for all aliases. 98 | 99 | .IP \(bu 100 | \fBimport\-fish\fR <\fIfile\fR> 101 | 102 | Adds abbreviations exported from fish. 103 | 104 | .IP \(bu 105 | \fBimport\-git\-aliases\fR [\fI--file \fR] [\fI--prefix\fR <\fIABBREVIATION prefix\fR>] 106 | 107 | Add an abbreviation for every Git alias available in the current session. The EXPANSION is prefixed with `git[Space]`. Use `--file ` to use a config file instead of the one specified by GIT_CONFIG (see `man git-config`). Use `--prefix ` to add a prefix to the ABBREVIATION. 108 | 109 | .IP \(bu 110 | \fBabbr list\fR 111 | 112 | Lists the available abbreviations without their expansions. Equivalent to fish's `abbr --list`. 113 | 114 | .IP \(bu 115 | \fBlist\-abbreviations\fR or \fBl\fR 116 | 117 | Lists all abbreviations. 118 | 119 | .IP \(bu 120 | \fBlist\-commands\fR or \fBL\fR 121 | 122 | Lists all abbreviations as commands suitable for export and import. 123 | 124 | .IP \(bu 125 | \fBrename\fR <\fIold_abbreviation\fR> <\fInew_abbreviation\fR> or \fBR\fR <\fIold_abbreviation\fR> <\fInew_abbreviation\fR> 126 | 127 | Renames an abbreviation, from <\fIold_abbreviation\fR> to <\fInew_abbreviation\fR>. 128 | 129 | .IP \(bu 130 | \fBprofile\fR 131 | 132 | Log profile information for debugging. 133 | 134 | .IP \(bu 135 | \fBversion\fR or \fB\-\-version\fR or \fB\-v\fR 136 | 137 | Show the current version. 138 | 139 | 140 | .PP 141 | All commands except for \fBclear-session\fR and \fBexpand\fR can take a \fBscope\fR: 142 | .RS 143 | .IP \(bu 144 | \fB\-\-session\fR 145 | or 146 | \fB\-S\fR 147 | 148 | Abbreviations available in the current session only. 149 | 150 | .IP \(bu 151 | \fB\-\-user\fR or \fB\-U\fR 152 | 153 | Abbreviations available to all current and future sessions. 154 | 155 | .RE 156 | 157 | All except for \fBclear-session\fR, \fBexpand\fR, and \fBimport-fish\fR can take a \fBtype\fR: 158 | .RS 159 | 160 | .IP \(bu 161 | \fB\-\-global\fR or \fB\-g\fR 162 | 163 | Abbreviation will expand anywhere on a line, rather than only in command (first word) position. 164 | 165 | .IP \(bu 166 | \fB\-\-regular\fR or \fBr\fR (default) 167 | 168 | Abbreviation will expand in command (first word) position only. 169 | 170 | .RE 171 | 172 | All except for \fBclear-session\fR, \fBexpand\fR, \fBexport-aliases\fR, \fBlist-abbreviations\fR, and \fBlist-commands\fR can be tried without making changes: 173 | .RS 174 | 175 | .IP \(bu 176 | \fB\-\-dry\-run\fR 177 | Show whats the result of the command would be. 178 | 179 | .RE 180 | 181 | All except for \fBclear-session\fR, \fBexpand\fR, \fBexport-aliases\fR, \fBlist-abbreviations\fR, and \fBlist-commands\fR can be run with reduced output: 182 | .RS 183 | 184 | .IP \(bu 185 | \fB\-\-quiet\fR | \fB\-q\fR 186 | Do not log success, warning, or error messages. 187 | 188 | .IP \(bu 189 | \fB\-\-quieter\fR | \fB\-qq\fR 190 | Silence the warning that a newly-created abbreviation conflicts with a command name. 191 | 192 | .SH Configuration 193 | The following variables may be set: 194 | 195 | .IP \(bu 196 | \fIABBR_AUTOLOAD\fR 197 | Should `abbr load` run before every `abbr` command? (0 or 1, default 1) 198 | 199 | .IP \(bu 200 | \fIABBR_DEFAULT_BINDINGS\fR 201 | Use the default key bindings? (0 or 1, default 1) 202 | 203 | .IP \(bu 204 | \fIABBR_DEBUG\fR 205 | Print debugging logs? (0 or 1, default 0) 206 | 207 | .IP \(bu 208 | \fIABBR_DRY_RUN\fR 209 | Behave as if `--dry-run` was passed? (0 or 1, default 0) 210 | 211 | .IP \(bu 212 | \fIABBR_FORCE\fR 213 | Behave as if `--force` was passed? (0 or 1, default 0) 214 | 215 | .IP \(bu 216 | \fIABBR_QUIET\fR 217 | Behave as if `--quiet` was passed? (0 or 1, default 0) 218 | 219 | .IP \(bu 220 | \fIABBR_USER_ABBREVIATIONS_FILE\fR 221 | File abbreviations are stored in (default ${HOME}/.config/zsh/abbreviations) 222 | 223 | .IP \(bu 224 | \fINO_COLOR\fR 225 | If `NO_COLOR` is set, color output is disabled. See https://no-color.org/. 226 | 227 | .SH EXAMPLES 228 | 229 | .TP 230 | \fBabbr\fR gco="git checkout" 231 | 232 | "gco" will be expanded as "git checkout" when it is the first word in the command, in all open and future sessions. 233 | 234 | .TP 235 | \fBabbr \-g\fR gco="git checkout" 236 | 237 | "gco" will be replaced with "git checkout" anywhere on the line, in all open and future sessions. 238 | 239 | .TP 240 | \fBabbr \-g \-S\fR gco="git checkout" 241 | 242 | "gco" will be replaced with "git checkout" anywhere on the line, in the current session. 243 | 244 | .TP 245 | \fBabbr e \-S \-g\fR gco; 246 | 247 | Erase the global session abbreviation "gco". Note that because expansion is triggered by [\fBSPACE\fR] and [\fBENTER\fR], the semicolon (;) is necessary to prevent expansion when operating on global abbreviations. 248 | 249 | .TP 250 | \fBabbr e \-g\fR gco; 251 | 252 | Erase the global user abbreviation "gco". 253 | 254 | .TP 255 | \fBabbr e\fR gco 256 | 257 | Erase the regular user abbrevation "gco". 258 | 259 | .TP 260 | \fBabbr R \-g\fR gco gch 261 | 262 | Rename an existing global user abbreviation from "gco" to "gch". 263 | 264 | .SH HISTORY 265 | Inspired by \fBfish\fR shell's \fBabbr\fR. 266 | 267 | .SH AUTHORS 268 | 269 | Henry Bley\-Vroman 270 | -------------------------------------------------------------------------------- /performance/README.md: -------------------------------------------------------------------------------- 1 | ## Performance 2 | 3 | Requires [zsh-bench](https://github.com/romkatv/zsh-bench). 4 | 5 | Run with 6 | 7 | ```shell 8 | zsh-bench --isolation docker --config-dir ./performance -- not-installed fresh-install zero-abbreviations ten-abbreviations one-hundred-abbreviations 9 | ``` 10 | 11 | Data is at . 12 | -------------------------------------------------------------------------------- /performance/fresh-install/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | emulate -L zsh -o err_return 4 | 5 | cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/ 6 | cd 7 | git clone -q --depth=1 --single-branch --branch v5 https://github.com/olets/zsh-abbr.git 8 | -------------------------------------------------------------------------------- /performance/fresh-install/skel/.zshenv: -------------------------------------------------------------------------------- 1 | setopt no_global_rcs 2 | -------------------------------------------------------------------------------- /performance/not-installed/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | emulate -L zsh -o err_return 4 | 5 | cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/ 6 | cd 7 | -------------------------------------------------------------------------------- /performance/not-installed/skel/.zshenv: -------------------------------------------------------------------------------- 1 | setopt no_global_rcs 2 | -------------------------------------------------------------------------------- /performance/one-hundred-abbreviations/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | emulate -L zsh -o err_return 4 | 5 | cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/ 6 | cd 7 | git clone -q --depth=1 --single-branch --branch v5 https://github.com/olets/zsh-abbr.git 8 | -------------------------------------------------------------------------------- /performance/one-hundred-abbreviations/skel/.zshenv: -------------------------------------------------------------------------------- 1 | setopt no_global_rcs 2 | -------------------------------------------------------------------------------- /performance/one-hundred-abbreviations/skel/.zshrc: -------------------------------------------------------------------------------- 1 | ABBR_USER_ABBREVIATIONS_FILE=~/user-abbreviations 2 | source ~/zsh-abbr/zsh-abbr.zsh 3 | -------------------------------------------------------------------------------- /performance/one-hundred-abbreviations/skel/user-abbreviations: -------------------------------------------------------------------------------- 1 | abbr "1"="1" 2 | abbr "2"="2" 3 | abbr "3"="3" 4 | abbr "4"="4" 5 | abbr "5"="5" 6 | abbr "6"="6" 7 | abbr "7"="7" 8 | abbr "8"="8" 9 | abbr "9"="9" 10 | abbr "10"="10" 11 | abbr "11"="11" 12 | abbr "12"="12" 13 | abbr "13"="13" 14 | abbr "14"="14" 15 | abbr "15"="15" 16 | abbr "16"="16" 17 | abbr "17"="17" 18 | abbr "18"="18" 19 | abbr "19"="19" 20 | abbr "20"="20" 21 | abbr "21"="21" 22 | abbr "22"="22" 23 | abbr "23"="23" 24 | abbr "24"="24" 25 | abbr "25"="25" 26 | abbr "26"="26" 27 | abbr "27"="27" 28 | abbr "28"="28" 29 | abbr "29"="29" 30 | abbr "30"="30" 31 | abbr "31"="31" 32 | abbr "32"="32" 33 | abbr "33"="33" 34 | abbr "34"="34" 35 | abbr "35"="35" 36 | abbr "36"="36" 37 | abbr "37"="37" 38 | abbr "38"="38" 39 | abbr "39"="39" 40 | abbr "40"="40" 41 | abbr "41"="41" 42 | abbr "42"="42" 43 | abbr "43"="43" 44 | abbr "44"="44" 45 | abbr "45"="45" 46 | abbr "46"="46" 47 | abbr "47"="47" 48 | abbr "48"="48" 49 | abbr "49"="49" 50 | abbr "50"="50" 51 | abbr "51"="51" 52 | abbr "52"="52" 53 | abbr "53"="53" 54 | abbr "54"="54" 55 | abbr "55"="55" 56 | abbr "56"="56" 57 | abbr "57"="57" 58 | abbr "58"="58" 59 | abbr "59"="59" 60 | abbr "60"="60" 61 | abbr "61"="61" 62 | abbr "62"="62" 63 | abbr "63"="63" 64 | abbr "64"="64" 65 | abbr "65"="65" 66 | abbr "66"="66" 67 | abbr "67"="67" 68 | abbr "68"="68" 69 | abbr "69"="69" 70 | abbr "70"="70" 71 | abbr "71"="71" 72 | abbr "72"="72" 73 | abbr "73"="73" 74 | abbr "74"="74" 75 | abbr "75"="75" 76 | abbr "76"="76" 77 | abbr "77"="77" 78 | abbr "78"="78" 79 | abbr "79"="79" 80 | abbr "80"="80" 81 | abbr "81"="81" 82 | abbr "82"="82" 83 | abbr "83"="83" 84 | abbr "84"="84" 85 | abbr "85"="85" 86 | abbr "86"="86" 87 | abbr "87"="87" 88 | abbr "88"="88" 89 | abbr "89"="89" 90 | abbr "90"="90" 91 | abbr "91"="91" 92 | abbr "92"="92" 93 | abbr "93"="93" 94 | abbr "94"="94" 95 | abbr "95"="95" 96 | abbr "96"="96" 97 | abbr "97"="97" 98 | abbr "98"="98" 99 | abbr "99"="99" 100 | abbr "100"="100" -------------------------------------------------------------------------------- /performance/ten-abbreviations/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | emulate -L zsh -o err_return 4 | 5 | cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/ 6 | cd 7 | git clone -q --depth=1 --single-branch --branch v5 https://github.com/olets/zsh-abbr.git 8 | -------------------------------------------------------------------------------- /performance/ten-abbreviations/skel/.zshenv: -------------------------------------------------------------------------------- 1 | setopt no_global_rcs 2 | -------------------------------------------------------------------------------- /performance/ten-abbreviations/skel/.zshrc: -------------------------------------------------------------------------------- 1 | ABBR_USER_ABBREVIATIONS_FILE=~/user-abbreviations 2 | source ~/zsh-abbr/zsh-abbr.zsh 3 | -------------------------------------------------------------------------------- /performance/ten-abbreviations/skel/user-abbreviations: -------------------------------------------------------------------------------- 1 | abbr "a"="a" 2 | abbr "b"="b" 3 | abbr "c"="c" 4 | abbr "d"="d" 5 | abbr "e"="e" 6 | abbr "f"="f" 7 | abbr "g"="g" 8 | abbr "h"="h" 9 | abbr "i"="i" 10 | abbr "j"="j" 11 | -------------------------------------------------------------------------------- /performance/zero-abbreviations/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | emulate -L zsh -o err_return 4 | 5 | cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/ 6 | cd 7 | git clone -q --depth=1 --single-branch --branch v5 https://github.com/olets/zsh-abbr.git 8 | -------------------------------------------------------------------------------- /performance/zero-abbreviations/skel/.zshenv: -------------------------------------------------------------------------------- 1 | setopt no_global_rcs 2 | -------------------------------------------------------------------------------- /performance/zero-abbreviations/skel/.zshrc: -------------------------------------------------------------------------------- 1 | ABBR_USER_ABBREVIATIONS_FILE=~/user-abbreviations 2 | source ~/zsh-abbr/zsh-abbr.zsh 3 | -------------------------------------------------------------------------------- /performance/zero-abbreviations/skel/user-abbreviations: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olets/zsh-abbr/f9e43d78110db0a8bf8ec75ca5b101a06b1d5ce8/performance/zero-abbreviations/skel/user-abbreviations -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # Tests 2 | 3 | Requires [zsh-test-runner](https://github.com/olets/zsh-test-runner) v2.x. 4 | 5 | To run the test suite in the current shell, 6 | 7 | ```shell 8 | . ./index.ztr.zsh 9 | ``` 10 | 11 | To run a single command's tests in the current shell, 12 | 13 | ```shell 14 | . ./index.ztr.zsh # e.g. `. ./index.ztr.zsh add` 15 | ``` 16 | 17 | To run the test suite in a subshell, 18 | 19 | ```shell 20 | ztr_path=$ZTR_PATH zsh ./index.ztr.zsh && abbr load 21 | ``` 22 | 23 | To run a single command's tests in a subshell, 24 | 25 | ```shell 26 | ztr_path=$ZTR_PATH zsh ./index.ztr.zsh && abbr load 27 | # e.g. `ztr_path=$ZTR_PATH zsh ./index.ztr.zsh add && abbr load` 28 | ``` -------------------------------------------------------------------------------- /tests/abbr-add.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | emulate -LR zsh 5 | 6 | { 7 | ZTR_TEARDOWN_FN() { 8 | emulate -LR zsh 9 | 10 | abbr erase $test_abbr_abbreviation 11 | } 12 | 13 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 14 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 15 | "Can add an abbreviation with the add subcommand" \ 16 | "Dependencies: erase, expand" 17 | 18 | abbr -S add $test_abbr_abbreviation=$test_abbr_expansion 19 | ztr test '[[ $(abbr -S expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 20 | "Can add a regular session abbreviation with the add subcommand, with the flag before the command" \ 21 | "Dependencies: erase, expand" 22 | 23 | abbr add $test_abbr_abbreviation=$test_abbr_expansion -S 24 | ztr test '[[ $(abbr -S expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 25 | "Can add a regular session abbreviation with the add subcommand, with the flag after the command args" \ 26 | "Dependencies: erase, expand" 27 | 28 | abbr add -S $test_abbr_abbreviation=$test_abbr_expansion 29 | ztr test '[[ $(abbr -S expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 30 | "Can add a regular session abbreviation with the add subcommand, with the flag between the command and its args" \ 31 | "Dependencies: erase, expand" 32 | 33 | # Manual 34 | 35 | echo "abbr \"$test_abbr_abbreviation\"=\"$test_abbr_expansion\"" > $ABBR_USER_ABBREVIATIONS_FILE 36 | abbr load 37 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 38 | "Can add a user abbreviation from outside abbr without data loss" \ 39 | "Dependencies: erase, expand" 40 | 41 | # Implicit 42 | 43 | abbr $test_abbr_abbreviation=$test_abbr_expansion 44 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 45 | "Can add an abbreviation without the add subcommand" \ 46 | "Dependencies: erase, expand" 47 | 48 | abbr $test_abbr_abbreviation_multiword=$test_abbr_expansion 49 | ztr test '[[ $(abbr expand $test_abbr_abbreviation_multiword) == $test_abbr_expansion ]]' \ 50 | "Can add a multi-word abbreviation without the add subcommand" \ 51 | "Dependencies: erase, expand" 52 | abbr erase $test_abbr_abbreviation_multiword 53 | 54 | # Global 55 | 56 | abbr add -g $test_abbr_abbreviation=$test_abbr_expansion 57 | ztr test '[[ $(abbr -g expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 58 | "Can add a global abbreviation with the add subcommand" \ 59 | "Dependencies: erase, expand" 60 | 61 | abbr add -S -g $test_abbr_abbreviation=$test_abbr_expansion 62 | ztr test '[[ $(abbr -g -S expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 63 | "Can add a global session abbreviation with the add subcommand" \ 64 | "Dependencies: erase, expand" 65 | 66 | # Multiword 67 | 68 | abbr add $test_abbr_abbreviation_multiword=$test_abbr_expansion 69 | ztr test '[[ $(abbr expand $test_abbr_abbreviation_multiword) == $test_abbr_expansion ]]' \ 70 | "Can add a multi-word abbreviation with the add subcommand" \ 71 | "Dependencies: erase, expand" 72 | abbr erase $test_abbr_abbreviation_multiword 73 | 74 | abbr add -S $test_abbr_abbreviation_multiword=$test_abbr_expansion 75 | ztr test '[[ $(abbr -S expand $test_abbr_abbreviation_multiword) == $test_abbr_expansion ]]' \ 76 | "Can add a multi-word regular session abbreviation with the add subcommand" \ 77 | "Dependencies: erase, expand" 78 | abbr erase $test_abbr_abbreviation_multiword 79 | 80 | # Multiword global 81 | 82 | abbr add -g $test_abbr_abbreviation_multiword=$test_abbr_expansion 83 | ztr test '[[ $(abbr -g expand $test_abbr_abbreviation_multiword) == $test_abbr_expansion ]]' \ 84 | "Can add a multi-word global abbreviation with the add subcommand" \ 85 | "Dependencies: erase, expand" 86 | abbr erase $test_abbr_abbreviation_multiword 87 | 88 | abbr add -S -g $test_abbr_abbreviation_multiword=$test_abbr_expansion 89 | ztr test '[[ $(abbr -g -S expand $test_abbr_abbreviation_multiword) == $test_abbr_expansion ]]' \ 90 | "Can add a multi-word global session abbreviation with the add subcommand" \ 91 | "Dependencies: erase, expand" 92 | abbr erase $test_abbr_abbreviation_multiword 93 | 94 | # Quotes 95 | 96 | expansion='b'cd 97 | abbr $test_abbr_abbreviation=$expansion 98 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $expansion ]]' \ 99 | "Bare single quotes at the start of the expansion are swallowed" \ 100 | "Dependencies: erase, expand" 101 | 102 | expansion=b'c'd 103 | abbr $test_abbr_abbreviation=$expansion 104 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $expansion ]]' \ 105 | "Bare single quotes in the middle of the expansion are swallowed" \ 106 | "Dependencies: erase, expand" 107 | 108 | expansion='b"c"d' 109 | abbr $test_abbr_abbreviation=$expansion 110 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $expansion ]]' \ 111 | "Single-quoted double quotes in the expansion are preserved" \ 112 | "Dependencies: erase, expand" 113 | 114 | expansion="b"cd 115 | abbr $test_abbr_abbreviation=$expansion 116 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $expansion ]]' \ 117 | "Bare double quotes at the start of the expansion are swallowed" \ 118 | "Dependencies: erase, expand" 119 | 120 | expansion=b"c"d 121 | abbr $test_abbr_abbreviation=$expansion 122 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $expansion ]]' \ 123 | "Bare double quotes in the middle of the expansion are swallowed" \ 124 | "Dependencies: erase, expand" 125 | 126 | expansion="b'c'd" 127 | abbr $test_abbr_abbreviation=$expansion 128 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $expansion ]]' \ 129 | "Double-quoted single quotes in the expansion are preserved" \ 130 | "Dependencies: erase, expand" 131 | 132 | # Force 133 | 134 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 135 | abbr add $test_abbr_abbreviation=$test_abbr_expansion_2 136 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 137 | "Cannot change an abbreviation's expansion" \ 138 | "Dependencies: erase, expand" 139 | 140 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 141 | abbr add --force $test_abbr_abbreviation=$test_abbr_expansion_2 142 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion_2 ]]' \ 143 | "Cannot change an abbreviation's expansion with --force" \ 144 | "Dependencies: erase, expand" 145 | 146 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 147 | abbr add -f $test_abbr_abbreviation=$test_abbr_expansion_2 148 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion_2 ]]' \ 149 | "Cannot change an abbreviation's expansion with -f" \ 150 | "Dependencies: erase, expand" 151 | } always { 152 | unfunction -m ZTR_TEARDOWN_FN 153 | } 154 | } 155 | 156 | main 157 | -------------------------------------------------------------------------------- /tests/abbr-clear-session.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | emulate -LR zsh 5 | 6 | abbr -S $test_abbr_abbreviation=$test_abbr_expansion 7 | abbr clear-session 8 | ztr test '(( ${#ABBR_REGULAR_SESSION_ABBREVIATIONS} == 0 ))' \ 9 | "Can clear session abbreviations" 10 | } 11 | 12 | main 13 | -------------------------------------------------------------------------------- /tests/abbr-config.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | emulate -LR zsh 5 | 6 | ztr test '[[ $ABBR_EXPANSION_CURSOR_MARKER == $ABBR_LINE_CURSOR_MARKER ]]' \ 7 | "Expansion cursor marker defaults to line cursor marker value" 8 | } 9 | 10 | main 11 | -------------------------------------------------------------------------------- /tests/abbr-erase.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | emulate -LR zsh 5 | 6 | { 7 | ZTR_TEARDOWN_FN() { 8 | emulate -LR zsh 9 | 10 | [[ $ABBR_USER_ABBREVIATIONS_FILE != $ABBR_USER_ABBREVIATIONS_FILE_SAVED ]] && \ 11 | echo '' > $ABBR_USER_ABBREVIATIONS_FILE 12 | } 13 | 14 | # More contexts - for example --global / -g, --regular / -r, --session / -S, --user / -U, are tested in abbr-add.ztr.zsh 15 | 16 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 17 | abbr erase $test_abbr_abbreviation 18 | ztr test '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 19 | "Can erase an abbreviation" \ 20 | "Dependencies: add, erase" 21 | 22 | abbr add ${test_abbr_abbreviation}^=$test_abbr_expansion 23 | abbr erase ${test_abbr_abbreviation}^ 24 | ztr test '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 25 | "Can erase an abbreviation ending in a caret" \ 26 | "Dependencies: add, erase." 27 | 28 | abbr add ^$test_abbr_abbreviation=$test_abbr_expansion 29 | abbr erase ^$test_abbr_abbreviation 30 | ztr test '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 31 | "Can erase an abbreviation starting with a caret" \ 32 | "Dependencies: add, erase." 33 | 34 | abbr add ${test_abbr_abbreviation}^${test_abbr_abbreviation}=$test_abbr_expansion 35 | abbr erase ${test_abbr_abbreviation}^${test_abbr_abbreviation} 36 | ztr test '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 37 | "Can erase an abbreviation with an embedded caret" \ 38 | "Dependencies: add, erase." 39 | 40 | abbr add "${test_abbr_abbreviation}#"=$test_abbr_expansion 41 | abbr erase "${test_abbr_abbreviation}#" 42 | ztr test '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 43 | "Can erase an abbreviation ending in a hash" \ 44 | "Dependencies: add, erase." 45 | 46 | abbr add "#$test_abbr_abbreviation"=$test_abbr_expansion 47 | abbr erase "#$test_abbr_abbreviation" 48 | ztr test '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 49 | "Can erase an abbreviation starting with a hash" \ 50 | "Dependencies: add, erase." 51 | 52 | abbr add "${test_abbr_abbreviation}#${test_abbr_abbreviation}"=$test_abbr_expansion 53 | abbr erase "${test_abbr_abbreviation}#${test_abbr_abbreviation}" 54 | ztr test '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 55 | "Can erase an abbreviation with an embedded hash" \ 56 | "Dependencies: add, erase." 57 | 58 | # TODO 59 | # See 60 | # - https://github.com/olets/zsh-abbr/issues/84 61 | # - https://github.com/olets/zsh-abbr/issues/118 62 | abbr add ${test_abbr_abbreviation}\!=$test_abbr_expansion 63 | abbr erase $test_abbr_abbreviation'!' 64 | ztr skip '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 65 | "@TODO. Can erase an abbreviation ending in an escaped exclamation point" \ 66 | "Dependencies: add, erase. GitHub issues: #84, #118" 67 | 68 | # See 69 | # - https://github.com/olets/zsh-abbr/issues/84 70 | # - https://github.com/olets/zsh-abbr/issues/118 71 | abbr add \!$test_abbr_abbreviation=$test_abbr_expansion 72 | abbr erase \!$test_abbr_abbreviation 73 | ztr skip '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 74 | "@TODO. Can erase an abbreviation starting with an escaped exclamation point" \ 75 | "Dependencies: add, erase. GitHub issues: #84, #118" 76 | 77 | # See 78 | # - https://github.com/olets/zsh-abbr/issues/84 79 | # - https://github.com/olets/zsh-abbr/issues/118 80 | abbr add '!'$test_abbr_abbreviation=$test_abbr_expansion 81 | abbr erase '!'$test_abbr_abbreviation 82 | ztr skip '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 83 | "@TODO. Can erase an abbreviation starting with a single-quoted exclamation point" \ 84 | "Dependencies: add, erase. GitHub issues: #84, #118" 85 | 86 | # See 87 | # - https://github.com/olets/zsh-abbr/issues/118 88 | local single_quoted_abbreviation="'" 89 | single_quoted_abbreviation+=$test_abbr_abbreviation 90 | single_quoted_abbreviation+="'" 91 | abbr add $single_quoted_abbreviation=$test_abbr_expansion 92 | abbr erase $single_quoted_abbreviation 93 | ztr skip '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 94 | "@TODO. Can erase an abbreviation with single quotation marks" \ 95 | "Dependencies: add, erase. GitHub issues: #118" 96 | 97 | # See 98 | # - https://github.com/olets/zsh-abbr/issues/118 99 | local double_quoted_abbreviation='"' 100 | double_quoted_abbreviation+=$test_abbr_abbreviation 101 | double_quoted_abbreviation+='"' 102 | abbr add $double_quoted_abbreviation=$test_abbr_expansion 103 | abbr erase $double_quoted_abbreviation 104 | ztr skip '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 105 | "@TODO. Can erase an abbreviation starting with double quotation marks" \ 106 | "Dependencies: add, erase. GitHub issues: #118" 107 | 108 | # Manual 109 | 110 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 111 | echo '' > $ABBR_USER_ABBREVIATIONS_FILE 112 | ztr test '[[ -z $(abbr expand $test_abbr_abbreviation) ]]' \ 113 | "Can delete a user abbreviation from outside abbr without unexpected retention" 114 | 115 | 116 | # Multiword 117 | 118 | abbr add $test_abbr_abbreviation_multiword=$test_abbr_expansion 119 | abbr erase $test_abbr_abbreviation_multiword 120 | ztr test '(( ${#ABBR_REGULAR_USER_ABBREVIATIONS} == 0 ))' \ 121 | "Can erase a multi-word abbreviation" \ 122 | "Dependencies: add, erase" 123 | } always { 124 | unfunction -m ZTR_TEARDOWN_FN 125 | } 126 | } 127 | 128 | main 129 | -------------------------------------------------------------------------------- /tests/abbr-expand.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | emulate -LR zsh 5 | 6 | { 7 | ZTR_TEARDOWN_FN() { 8 | emulate -LR zsh 9 | 10 | abbr erase $test_abbr_abbreviation 11 | } 12 | 13 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 14 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 15 | "Can expand an abbreviation in a script" \ 16 | "Dependencies: erase" 17 | 18 | abbr -g add $test_abbr_abbreviation=$test_abbr_expansion 19 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 20 | "Can expand a global abbreviation in a script with the flag before the command" \ 21 | "Dependencies: erase" 22 | 23 | abbr add $test_abbr_abbreviation=$test_abbr_expansion -g 24 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 25 | "Can expand a global abbreviation in a script with the flag after the command args" \ 26 | "Dependencies: erase" 27 | 28 | abbr add -g $test_abbr_abbreviation=$test_abbr_expansion 29 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 30 | "Can expand a global abbreviation in a script with the flag between the command and its args" \ 31 | "Dependencies: erase" 32 | 33 | abbr add -S $test_abbr_abbreviation=$test_abbr_expansion 34 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 35 | "Can expand a session abbreviation in a script" \ 36 | "Dependencies: erase" 37 | 38 | abbr add -S -g $test_abbr_abbreviation=$test_abbr_expansion 39 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == $test_abbr_expansion ]]' \ 40 | "Can expand a global session abbreviation in a script" \ 41 | "Dependencies: erase" 42 | 43 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 44 | ztr test '[[ $(abbr expand "$prefix_one_word$test_abbr_abbreviation") == "$prefix_one_word$test_abbr_expansion" ]]' \ 45 | "Can expand an abbreviation, prefixed with one word, in a script" \ 46 | "Dependencies: erase" 47 | 48 | abbr add -S $test_abbr_abbreviation=$test_abbr_expansion 49 | ztr test '[[ $(abbr expand "$prefix_one_word$test_abbr_abbreviation") == "$prefix_one_word$test_abbr_expansion" ]]' \ 50 | "Can expand a session abbreviation, prefixed with one word, in a script" \ 51 | "Dependencies: erase" 52 | 53 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 54 | ztr test '[[ $(abbr expand "$prefix_multi_word$test_abbr_abbreviation") == "$prefix_multi_word$test_abbr_expansion" ]]' \ 55 | "Can expand an abbreviation, prefixed with multiple words, in a script" \ 56 | "Dependencies: erase" 57 | 58 | abbr add -S $test_abbr_abbreviation=$test_abbr_expansion 59 | ztr test '[[ $(abbr expand "$prefix_multi_word$test_abbr_abbreviation") == "$prefix_multi_word$test_abbr_expansion" ]]' \ 60 | "Can expand a session abbreviation, prefixed with multiple words, in a script" \ 61 | "Dependencies: erase" 62 | 63 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 64 | ztr test '[[ $(abbr expand "$prefix_double_quotes$test_abbr_abbreviation") == "$prefix_double_quotes$test_abbr_expansion" ]]' \ 65 | "Can expand an abbreviation, prefixed with a prefix containing single-quoted double quotes, in a script" \ 66 | "Dependencies: erase" 67 | 68 | abbr add -S $test_abbr_abbreviation=$test_abbr_expansion 69 | ztr test '[[ $(abbr expand "$prefix_double_quotes$test_abbr_abbreviation") == "$prefix_double_quotes$test_abbr_expansion" ]]' \ 70 | "Can expand a session abbreviation, prefixed with a prefix containing single-quoted double quotes, in a script" \ 71 | "Dependencies: erase" 72 | 73 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 74 | ztr test '[[ $(abbr expand "$prefix_single_quotes$test_abbr_abbreviation") == "$prefix_single_quotes$test_abbr_expansion" ]]' \ 75 | "Can expand an abbreviation, prefixed with a prefix containing double-quoted single quotes, in a script" \ 76 | "Dependencies: erase" 77 | 78 | abbr add -S $test_abbr_abbreviation=$test_abbr_expansion 79 | ztr test '[[ $(abbr expand "$prefix_single_quotes$test_abbr_abbreviation") == "$prefix_single_quotes$test_abbr_expansion" ]]' \ 80 | "Can expand a session abbreviation, prefixed with a prefix containing double-quoted single quotes, in a script" \ 81 | "Dependencies: erase" 82 | 83 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 84 | ztr test '[[ $(abbr expand "$prefix_glob_1_match_1$test_abbr_abbreviation") == "$prefix_glob_1_match_1$test_abbr_expansion" ]]' \ 85 | "Can expand an abbreviation, prefixed with a glob, in a script — 1/n" \ 86 | "Dependencies: erase" 87 | 88 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 89 | ztr test '[[ $(abbr expand "$prefix_glob_1_match_2$test_abbr_abbreviation") == "$prefix_glob_1_match_2$test_abbr_expansion" ]]' \ 90 | "Can expand an abbreviation, prefixed with a glob, in a script — 2/n" \ 91 | "Dependencies: erase" 92 | 93 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 94 | ztr test '[[ -z $(abbr expand "$prefix_glob_1_mismatch$test_abbr_abbreviation") ]]' \ 95 | "Can expand an abbreviation, prefixed with a glob, in a script — 3/n" \ 96 | "Dependencies: erase" 97 | 98 | abbr add $test_abbr_abbreviation=$test_abbr_expansion 99 | ztr test '[[ $(abbr expand "$prefix_multi_word$prefix_double_quotes$test_abbr_abbreviation") == "$prefix_multi_word$prefix_double_quotes$test_abbr_expansion" ]]' \ 100 | "Can expand an abbreviation, prefixed with a linear combination of scalar prefixes, in a script" \ 101 | "Dependencies: erase" 102 | 103 | abbr add -S $test_abbr_abbreviation=$test_abbr_expansion 104 | ztr test '[[ $(abbr expand "$prefix_glob_1_match_1$prefix_glob_2_match$test_abbr_abbreviation") == "$prefix_glob_1_match_1$prefix_glob_2_match$test_abbr_expansion" ]]' \ 105 | "Can expand a session abbreviation, prefixed with a linear combination of glob prefixes, in a script" \ 106 | "Dependencies: erase" 107 | 108 | abbr add -S $test_abbr_abbreviation=$test_abbr_expansion 109 | ztr test '[[ $(abbr expand "$prefix_double_quotes$prefix_glob_2_match$test_abbr_abbreviation") == "$prefix_double_quotes$prefix_glob_2_match$test_abbr_expansion" ]]' \ 110 | "Can expand a session abbreviation, prefixed with a scalar prefix followed by a glob prefix, in a script" \ 111 | "Dependencies: erase" 112 | 113 | abbr add -S $test_abbr_abbreviation=$test_abbr_expansion 114 | ztr test '[[ $(abbr expand "$prefix_glob_2_match$prefix_double_quotes$test_abbr_abbreviation") == "$prefix_glob_2_match$prefix_double_quotes$test_abbr_expansion" ]]' \ 115 | "Can expand a session abbreviation, prefixed with a glob prefix followed by a scalar prefix, in a script" \ 116 | "Dependencies: erase" 117 | 118 | abbr add -S $test_abbr_abbreviation=$test_abbr_expansion 119 | ztr test '[[ $(abbr expand "$prefix_glob_1_match_1$prefix_glob_2_match$prefix_double_quotes$prefix_multi_word$test_abbr_abbreviation") == "$prefix_glob_1_match_1$prefix_glob_2_match$prefix_double_quotes$prefix_multi_word$test_abbr_expansion" ]]' \ 120 | "Can expand a session abbreviation, prefixed with mixed glob and scalar prefixes, in a script" \ 121 | "Dependencies: erase" 122 | 123 | abbr $test_abbr_abbreviation_multiword=$test_abbr_expansion 124 | ztr test '[[ $(abbr expand $test_abbr_abbreviation_multiword) == $test_abbr_expansion ]]' \ 125 | "Can expand a two-word abbreviation in a script" \ 126 | "Dependencies: erase" 127 | abbr erase $test_abbr_abbreviation_multiword 128 | 129 | abbr "a b c"=$test_abbr_expansion 130 | ztr test '[[ $(abbr expand "a b c") == $test_abbr_expansion ]]' \ 131 | "Can expand a three-word abbreviation in a script" \ 132 | "Dependencies: erase" 133 | abbr erase "a b c" 134 | } always { 135 | unfunction -m ZTR_TEARDOWN_FN 136 | } 137 | } 138 | 139 | main 140 | -------------------------------------------------------------------------------- /tests/abbr-history.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | emulate -LR zsh 5 | 6 | ztr skip '@TODO' 'When ABBR_PUSH_HISTORY == 1, abbreviations are included in history' 7 | } 8 | 9 | main 10 | -------------------------------------------------------------------------------- /tests/abbr-import-aliases.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | emulate -LR zsh 5 | 6 | { 7 | ZTR_TEARDOWN_FN() { 8 | emulate -LR zsh 9 | 10 | local ztr_teardown_args 11 | ztr_teardown_args="$1" 12 | 13 | for k in ${(k)$(abbr list-abbreviations)}; do 14 | abbr erase $k 15 | done 16 | 17 | if [[ -n $ztr_teardown_args ]]; then 18 | unalias $ztr_teardown_args 19 | fi 20 | 21 | unset ZTR_TEARDOWN_ARGS 22 | } 23 | 24 | abbreviation=zsh_abbr_test_alias 25 | ZTR_TEARDOWN_ARGS=$abbreviation 26 | expansion=abc 27 | alias $abbreviation=$expansion 28 | abbr import-aliases 29 | ztr test '[[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)abbreviation}]} == ${(qqq)expansion} ]]' \ 30 | "Can import aliases" \ 31 | "Dependencies: erase" 32 | 33 | # Multiword 34 | 35 | abbreviation=zsh_abbr_test_alias 36 | ZTR_TEARDOWN_ARGS=$abbreviation 37 | expansion="a b" 38 | alias $abbreviation=$expansion 39 | abbr import-aliases 40 | ztr test '[[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)abbreviation}]} == ${(qqq)expansion} ]]' \ 41 | "Can import a multi-word alias" \ 42 | "Dependencies: erase" 43 | 44 | # Quotes 45 | 46 | abbreviation=zsh_abbr_test_alias 47 | ZTR_TEARDOWN_ARGS=$abbreviation 48 | expansion="a \"b\"" 49 | alias $abbreviation=$expansion 50 | abbr import-aliases 51 | ztr test '[[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)abbreviation}]} == ${(qqq)expansion} ]]' \ 52 | "Can import a double-quoted alias with escaped double quotation marks" \ 53 | "Dependencies: erase" 54 | 55 | abbreviation=zsh_abbr_test_alias 56 | ZTR_TEARDOWN_ARGS=$abbreviation 57 | expansion='a "b"' 58 | alias $abbreviation=$expansion 59 | abbr import-aliases 60 | ztr test '[[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)abbreviation}]} == ${(qqq)expansion} ]]' \ 61 | "Can import a single-quoted alias with double quotation marks" \ 62 | "Dependencies: erase" 63 | 64 | abbreviation=zsh_abbr_test_alias 65 | ZTR_TEARDOWN_ARGS=$abbreviation 66 | expansion="a 'b'" 67 | alias $abbreviation=$expansion 68 | abbr import-aliases 69 | ztr test '[[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)abbreviation}]} == ${(qqq)expansion} ]]' \ 70 | "Can import a double-quoted alias with single quotation marks" \ 71 | "Dependencies: erase" 72 | } always { 73 | unfunction -m ZTR_TEARDOWN_FN 74 | } 75 | } 76 | 77 | main 78 | -------------------------------------------------------------------------------- /tests/abbr-import-git.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | emulate -LR zsh 5 | 6 | abbr import-git-aliases --file $test_dir/test-gitconfig 7 | 8 | ztr test '[[ $(abbr expand test-subcommand) == "git status" ]]' \ 9 | "Can import regular user single-word subcommand Git aliases" \ 10 | "Dependencies: erase, expand" 11 | abbr erase test-subcommand 12 | 13 | ztr test '[[ $(abbr expand test-subcommand-multiword) == "git checkout main" ]]' \ 14 | "Can import regular user multi-word subcommand Git aliases" \ 15 | "Dependencies: erase, expand" 16 | abbr erase test-subcommand-multi-word 17 | 18 | ztr test '(( ! ${+ABBR_REGULAR_USER_ABBREVIATIONS["test-command"]} ))' \ 19 | "Cannot import command Git aliases" 20 | 21 | ztr test '(( ! ${+ABBR_REGULAR_USER_ABBREVIATIONS["test-function"]} ))' \ 22 | "Cannot import single-line function Git aliases" 23 | 24 | ztr test '(( ! ${+ABBR_REGULAR_USER_ABBREVIATIONS["test-function-multiline"]} ))' \ 25 | "Cannot import multi-line function Git aliases" 26 | 27 | abbr import-git-aliases -g --file $test_dir/test-gitconfig 28 | 29 | ztr test '(( ${+ABBR_GLOBAL_USER_ABBREVIATIONS["test-subcommand"]} ))' \ 30 | "Can import global single-word subcommand Git aliases" \ 31 | "Dependencies: erase, expand" 32 | abbr erase test-subcommand 33 | abbr erase test-subcommand-multi-word 34 | 35 | abbr import-git-aliases -S --file $test_dir/test-gitconfig 36 | 37 | ztr test '(( ${+ABBR_REGULAR_SESSION_ABBREVIATIONS["test-subcommand"]} ))' \ 38 | "Can import regular session single-word subcommand Git aliases" \ 39 | "Dependencies: erase, expand" 40 | abbr erase test-subcommand 41 | abbr erase test-subcommand-multi-word 42 | 43 | abbr import-git-aliases -S -g --file $test_dir/test-gitconfig 44 | 45 | ztr test '(( ${+ABBR_GLOBAL_SESSION_ABBREVIATIONS["test-subcommand"]} ))' \ 46 | "Can import global session single-word subcommand Git aliases" \ 47 | "Dependencies: erase, expand" 48 | abbr erase test-subcommand 49 | abbr erase test-subcommand-multi-word 50 | 51 | abbr import-git-aliases --file $test_dir/test-gitconfig --prefix "git " 52 | 53 | ztr test '[[ $(abbr expand "git test-subcommand") == "git status" ]]' \ 54 | "Can import prefixed regular user single-word subcommand Git aliases" \ 55 | "Dependencies: erase, expand" 56 | abbr erase test-subcommand 57 | 58 | ztr test '[[ $(abbr expand "git test-subcommand-multiword") == "git checkout main" ]]' \ 59 | "Can import prefixed regular user multi-word subcommand Git aliases" \ 60 | "Dependencies: erase, expand" 61 | abbr erase test-subcommand-multiword 62 | 63 | abbr git $test_abbr_abbreviation=$test_abbr_expansion 64 | ztr test '[[ $(abbr expand "git $test_abbr_abbreviation") == "git $test_abbr_expansion" ]]' \ 65 | "git adds a regular user abbreviation, prefixing the expansion with 'git '" \ 66 | "Dependencies: erase, expand" 67 | ztr test '[[ $(abbr expand $test_abbr_abbreviation) == "git $test_abbr_expansion" ]]' \ 68 | "git adds a regular user abbreviation, prefixing the abbreviation with 'g' and prefixing the expansion with 'git '" \ 69 | "Dependencies: erase, expand" 70 | abbr erase $test_abbr_abbreviation 71 | abbr erase -g "git $test_abbr_abbreviation" 72 | } 73 | 74 | main 75 | -------------------------------------------------------------------------------- /tests/abbr-rename.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | emulate -LR zsh 5 | 6 | abbr $test_abbr_abbreviation=$test_abbr_expansion 7 | abbr rename $test_abbr_abbreviation $test_abbr_abbreviation_2 8 | ztr test '! (( ${+ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation}]} )) \ 9 | && [[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation_2}]} == ${(qqq)test_abbr_expansion} ]]' \ 10 | "Can rename a single-word abbreviation to another single word" \ 11 | "Dependencies: erase" 12 | abbr erase --quiet $test_abbr_abbreviation 13 | abbr erase $test_abbr_abbreviation_2 14 | 15 | abbr $test_abbr_abbreviation=$test_abbr_expansion 16 | abbr rename $test_abbr_abbreviation $test_abbr_abbreviation_multiword 17 | ztr test '! (( ${+ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation}]} )) \ 18 | && [[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation_multiword}]} == ${(qqq)test_abbr_expansion} ]]' \ 19 | "Can rename an single-word abbreviation to multiple words" \ 20 | "Dependencies: erase" 21 | abbr erase --quiet $test_abbr_abbreviation 22 | abbr erase $test_abbr_abbreviation_multiword 23 | 24 | abbr $test_abbr_abbreviation_multiword=$test_abbr_expansion 25 | abbr rename $test_abbr_abbreviation_multiword $test_abbr_abbreviation 26 | ztr test '! (( ${+ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation_multiword}]} )) \ 27 | && [[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation}]} == ${(qqq)test_abbr_expansion} ]]' \ 28 | "Can rename an multi-word abbreviation to a single word" \ 29 | "Dependencies: erase" 30 | abbr erase --quiet $test_abbr_abbreviation_multiword 31 | abbr erase $test_abbr_abbreviation 32 | 33 | abbr $test_abbr_abbreviation_multiword=$test_abbr_expansion 34 | abbr rename $test_abbr_abbreviation_multiword $test_abbr_abbreviation_multiword_2 35 | ztr test '! (( ${+ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation_multiword}]} )) \ 36 | && [[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation_multiword_2}]} == ${(qqq)test_abbr_expansion} ]]' \ 37 | "Can rename an multi-word abbreviation to different words" \ 38 | "Dependencies: erase" 39 | abbr erase --quiet $test_abbr_abbreviation_multiword 40 | abbr erase $test_abbr_abbreviation_multiword_2 41 | 42 | abbr $test_abbr_abbreviation=$test_abbr_expansion 43 | abbr $test_abbr_abbreviation_2=$test_abbr_expansion_2 44 | abbr rename $test_abbr_abbreviation $test_abbr_abbreviation_2 45 | ztr test '(( ${+ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation}]} )) \ 46 | && [[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation_2}]} == ${(qqq)test_abbr_expansion_2} ]]' \ 47 | "Cannot rename a single-word abbreviation to an existing abbreviation" \ 48 | "Dependencies: erase" 49 | abbr erase --quiet $test_abbr_abbreviation 50 | abbr erase $test_abbr_abbreviation_2 51 | 52 | abbr $test_abbr_abbreviation=$test_abbr_expansion 53 | abbr $test_abbr_abbreviation_2=$test_abbr_expansion_2 54 | abbr --force rename $test_abbr_abbreviation $test_abbr_abbreviation_2 55 | ztr test '! (( ${+ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation}]} )) \ 56 | && [[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation_2}]} == ${(qqq)test_abbr_expansion} ]]' \ 57 | "Can rename a single-word abbreviation to an existing abbreviation with --force" \ 58 | "Dependencies: erase" 59 | abbr erase --quiet $test_abbr_abbreviation 60 | abbr erase $test_abbr_abbreviation_2 61 | 62 | abbr $test_abbr_abbreviation=$test_abbr_expansion 63 | abbr $test_abbr_abbreviation_2=$test_abbr_expansion_2 64 | abbr -f rename $test_abbr_abbreviation $test_abbr_abbreviation_2 65 | ztr test '! (( ${+ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation}]} )) \ 66 | && [[ ${ABBR_REGULAR_USER_ABBREVIATIONS[${(qqq)test_abbr_abbreviation_2}]} == ${(qqq)test_abbr_expansion} ]]' \ 67 | "Can rename a single-word abbreviation to an existing abbreviation with -f" \ 68 | "Dependencies: erase" 69 | abbr erase --quiet $test_abbr_abbreviation 70 | abbr erase $test_abbr_abbreviation_2 71 | } 72 | 73 | main 74 | -------------------------------------------------------------------------------- /tests/abbr-tmpdir.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | main() { 4 | emulate -LR zsh 5 | 6 | abbr $test_abbr_abbreviation=$test_abbr_expansion 7 | abbr rename $test_abbr_abbreviation $test_abbr_abbreviation_2 8 | ztr test '[[ $_abbr_tmpdir != $test_tmpdir ]] \ 9 | && [[ ${_abbr_tmpdir%/} == $test_tmpdir ]]' \ 10 | "Tmpdir does not have to end in a slash" 11 | 12 | ztr skip '@TODO' 'Distinct tmpdirs for privileged and unprivileged users' 13 | } 14 | 15 | main 16 | -------------------------------------------------------------------------------- /tests/index.ztr.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Tests require ztr 4 | # https://github.com/olets/zsh-test-runner 5 | 6 | # Run the test suite by 7 | # sourcing this file 8 | # 9 | # ``` 10 | # . 11 | # ``` 12 | # 13 | # or by running it in a subshell with ZTR_PATH passed in as ztr_path 14 | # 15 | # ``` 16 | # ztr_path=$ZTR_PATH zsh 17 | # ``` 18 | 19 | main() { 20 | emulate -LR zsh 21 | 22 | typeset -g ABBR_USER_ABBREVIATIONS_FILE_SAVED 23 | 24 | local \ 25 | abbr_dir \ 26 | abbr_expansion_cursor_marker_saved \ 27 | abbr_line_cursor_marker_saved \ 28 | abbr_tmpdir_saved \ 29 | aliases_saved \ 30 | cmd \ 31 | prefix_double_quotes \ 32 | prefix_glob \ 33 | prefix_glob_match_1 \ 34 | prefix_glob_match_2 \ 35 | prefix_glob_mismatch \ 36 | prefix_multi_word \ 37 | prefix_one_word \ 38 | prefix_single_quotes \ 39 | test_abbr_abbreviation \ 40 | test_abbr_abbreviation_2 \ 41 | test_abbr_abbreviation_multiword \ 42 | test_abbr_abbreviation_multiword_2 \ 43 | test_abbr_expansion \ 44 | test_abbr_expansion_2 \ 45 | test_dir \ 46 | test_prefix \ 47 | test_tmpdir 48 | 49 | local -a abbr_scalar_prefixes_saved 50 | local -a abbr_glob_prefixes_saved 51 | 52 | local -i abbr_quiet_saved 53 | 54 | ztr_path=${ztr_path:-$ZTR_PATH} 55 | 56 | if [[ -z $ztr_path ]]; then 57 | printf "You must provide \$ztr_path\n" 58 | return 1 59 | fi 60 | 61 | cmd=$1 62 | 63 | abbr_dir=${0:A:h} 64 | if [[ $abbr_dir =~ "/tests" ]]; then 65 | abbr_dir+=/.. 66 | fi 67 | 68 | prefix_double_quotes='prefix with "double quotes"' 69 | prefix_glob_1="?*globprefix1" 70 | prefix_glob_2="?*globprefix2" 71 | prefix_multi_word="multi-word prefix" 72 | prefix_one_word=one_word_prefix 73 | prefix_single_quotes="prefix with 'single quotes'" 74 | 75 | prefix_glob_1_match_1='.globprefix1' 76 | prefix_glob_1_match_2='..globprefix1' 77 | prefix_glob_1_mismatch='globprefix1' 78 | prefix_glob_2_match='.globprefix2' 79 | 80 | test_dir=$abbr_dir/tests 81 | 82 | if [[ ${(%):-%#} == '#' ]]; then 83 | test_tmpdir=${${TMPDIR:-/tmp}%/}/zsh-abbr-privileged-users-tests 84 | else 85 | test_tmpdir=${${TMPDIR:-/tmp}%/}/zsh-abbr-tests 86 | fi 87 | 88 | # Save user configuration 89 | abbr_expansion_cursor_marker_saved=$ABBR_EXPANSION_CURSOR_MARKER 90 | abbr_glob_prefixes_saved=( $ABBR_REGULAR_ABBREVIATION_GLOB_PREFIXES ) 91 | abbr_line_cursor_marker_saved=$ABBR_LINE_CURSOR_MARKER 92 | abbr_quiet_saved=$ABBR_QUIET 93 | abbr_scalar_prefixes_saved=( $ABBR_REGULAR_ABBREVIATION_SCALAR_PREFIXES ) 94 | abbr_tmpdir_saved=$ABBR_TMPDIR 95 | ABBR_USER_ABBREVIATIONS_FILE_SAVED=$ABBR_USER_ABBREVIATIONS_FILE 96 | aliases_saved=$(alias -L) 97 | 98 | # Configure 99 | unset ABBR_EXPANSION_CURSOR_MARKER 100 | unset ABBR_LINE_CURSOR_MARKER 101 | 102 | typeset -a ABBR_REGULAR_ABBREVIATION_SCALAR_PREFIXES=( ) 103 | ABBR_REGULAR_ABBREVIATION_SCALAR_PREFIXES+=( $prefix_double_quotes ) 104 | ABBR_REGULAR_ABBREVIATION_SCALAR_PREFIXES+=( $prefix_multi_word ) 105 | ABBR_REGULAR_ABBREVIATION_SCALAR_PREFIXES+=( $prefix_one_word ) 106 | ABBR_REGULAR_ABBREVIATION_SCALAR_PREFIXES+=( $prefix_single_quotes ) 107 | 108 | typeset -a ABBR_REGULAR_ABBREVIATION_GLOB_PREFIXES=( ) 109 | ABBR_REGULAR_ABBREVIATION_GLOB_PREFIXES+=( $prefix_glob_1 ) 110 | ABBR_REGULAR_ABBREVIATION_GLOB_PREFIXES+=( $prefix_glob_2 ) 111 | 112 | ABBR_QUIET=1 113 | ABBR_USER_ABBREVIATIONS_FILE=$test_dir/abbreviations.$RANDOM.tmp 114 | ABBR_TMPDIR=$test_tmpdir 115 | unalias -m '*' 116 | 117 | # Set up data 118 | touch $ABBR_USER_ABBREVIATIONS_FILE 119 | test_abbr_abbreviation="zsh_abbr_test" 120 | test_abbr_abbreviation_2="zsh_abbr_test_2" 121 | test_abbr_abbreviation_multiword="zsh_abbr_test second_word" 122 | test_abbr_abbreviation_multiword_2="zsh_abbr_test other_second_word" 123 | test_abbr_expansion="zsh abbr test" 124 | test_abbr_expansion_2="zsh abbr test 2" 125 | 126 | # Source dependencies 127 | . $abbr_dir/zsh-abbr.zsh 128 | . $ztr_path 129 | 130 | # Clear zsh-test-runner summary 131 | ztr clear-summary 132 | 133 | # Run tests 134 | if [[ -n $cmd ]]; then 135 | . $test_dir/abbr-$cmd.ztr.zsh 136 | else 137 | for f ($test_dir/abbr-*.ztr.zsh(N.)); do 138 | printf "File: %s\n" $f 139 | . $f 140 | echo - 141 | done 142 | fi 143 | 144 | # Remove artifacts 145 | rm -f $ABBR_USER_ABBREVIATIONS_FILE 146 | unalias -m '*' 147 | 148 | # Reset 149 | ABBR_EXPANSION_CURSOR_MARKER=$abbr_expansion_cursor_marker_saved 150 | ABBR_LINE_CURSOR_MARKER=$abbr_line_cursor_marker_saved 151 | ABBR_REGULAR_ABBREVIATION_GLOB_PREFIXES=( $abbr_glob_prefixes_saved ) 152 | ABBR_REGULAR_ABBREVIATION_SCALAR_PREFIXES=( $abbr_scalar_prefixes_saved ) 153 | ABBR_QUIET=$abbr_quiet_saved 154 | ABBR_TMPDIR=$abbr_tmpdir_saved 155 | ABBR_USER_ABBREVIATIONS_FILE=$ABBR_USER_ABBREVIATIONS_FILE_SAVED 156 | unset ABBR_USER_ABBREVIATIONS_FILE_SAVED 157 | eval $aliases_saved 158 | 159 | if $(command -v _abbr_load_user_abbreviations); then 160 | _abbr_load_user_abbreviations 161 | fi 162 | 163 | # Print test suite results 164 | ztr summary 165 | } 166 | 167 | main $@ 168 | -------------------------------------------------------------------------------- /tests/test-gitconfig: -------------------------------------------------------------------------------- 1 | [alias] 2 | test-subcommand = status 3 | test-subcommand-multiword = checkout main 4 | test-command = !git status 5 | test-function = ! "f() { git status }; f" 6 | test-function-multiline = ! "f() { \n\ 7 | git status \n\ 8 | }; f" 9 | -------------------------------------------------------------------------------- /tests/tests.plugin.zsh: -------------------------------------------------------------------------------- 1 | . ${0:A:h}/tests.zsh 2 | -------------------------------------------------------------------------------- /zsh-abbr.plugin.zsh: -------------------------------------------------------------------------------- 1 | fpath+=${0:A:h}/completions 2 | source ${0:A:h}/zsh-abbr.zsh 3 | --------------------------------------------------------------------------------