{"id":13528818,"url":"https://github.com/Gazorby/fish-abbreviation-tips","last_synced_at":"2025-04-01T14:33:09.176Z","repository":{"id":37055289,"uuid":"255135894","full_name":"gazorby/fish-abbreviation-tips","owner":"gazorby","description":"💡 Help you remembering your abbreviations","archived":false,"fork":false,"pushed_at":"2024-02-06T20:09:47.000Z","size":163,"stargazers_count":316,"open_issues_count":5,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T06:08:27.658Z","etag":null,"topics":["abbreviation","abbreviations","abbreviations-tips","fish","fish-plugin","fisher"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gazorby.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-12T17:35:10.000Z","updated_at":"2025-03-27T02:46:40.000Z","dependencies_parsed_at":"2024-06-19T02:51:58.833Z","dependency_job_id":"20cd55f0-71fd-4c31-b578-07df027cbb31","html_url":"https://github.com/gazorby/fish-abbreviation-tips","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gazorby%2Ffish-abbreviation-tips","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gazorby%2Ffish-abbreviation-tips/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gazorby%2Ffish-abbreviation-tips/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gazorby%2Ffish-abbreviation-tips/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gazorby","download_url":"https://codeload.github.com/gazorby/fish-abbreviation-tips/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246655293,"owners_count":20812613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abbreviation","abbreviations","abbreviations-tips","fish","fish-plugin","fisher"],"created_at":"2024-08-01T07:00:25.339Z","updated_at":"2025-04-01T14:33:09.141Z","avatar_url":"https://github.com/gazorby.png","language":"Shell","funding_links":[],"categories":["Plugins"],"sub_categories":["other plugin"],"readme":"# fish-abbreviation-tips [![Generic badge](https://img.shields.io/badge/Version-v0.5.1-\u003cCOLOR\u003e.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/fish-\u003e=3.1.0-red.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://shields.io/)\n\n[![asciicast](https://asciinema.org/a/322043.svg)](https://asciinema.org/a/322043)\n\nIt helps you remember abbreviations and aliases by displaying tips when you can use them.\n\n## ✅ Requirements\n\n- [fish](https://github.com/fish-shell/fish-shell) 3.1.0+\n\n## 🚀 Install\n\nInstall using [Fisher](https://github.com/jorgebucaran/fisher):\n\n```fish\nfisher install gazorby/fish-abbreviation-tips\n```\n\n## 🔧 Usage\n\nJust use your shell normally and enjoy tips!\n\n### Adding / removing abbreviations or aliases\n\nThe plugin automatically track changes when adding/removing abbreviations or aliases using `abbr` or `functions` commands (see [behind the scenes](#-behind-the-scenes)), so you won't see tips anymore for an abbreviation/alias that has been erased, and you will get new ones for newly added abbreviations/aliases\n\n## 🛠 Configuration\n\nConfiguration is done through environment variables.\n\nTo avoid spamming your `config.fish`, you can set environment variables using `set -U` once to make them persistent across restarts and share them across fish's instances.\n\n### Default configuration\n\n```fish\nABBR_TIPS_PROMPT \"\\n💡 \\e[1m{{ .abbr }}\\e[0m =\u003e {{ .cmd }}\"\nABBR_TIPS_ALIAS_WHITELIST # Not set\n\nABBR_TIPS_REGEXES '(^(\\w+\\s+)+(-{1,2})\\w+)(\\s\\S+)' '(^( ?\\w+){3}).*' '(^( ?\\w+){2}).*' '(^( ?\\w+){1}).*'\n# 1 : Test command with arguments removed\n# 2 : Test the firsts three words\n# 3 : Test the firsts two words\n# 4 : Test the first word\n```\n\n### Tips prompt\n\n`ABBR_TIPS_PROMPT`\n\nBy default, tips will show up like this :\n\n```console\n💡 ga =\u003e git add\n```\n\nBut you can customize it using the prompt environment variable. The plugin will replace `{{ .abbr }}` with the abbreviation/alias and `{{ .cmd }}` with the corresponding command.\n\n⚠️ tips are displayed using `echo -e` (interpretation of backslash escapes)\n\n### Alias whitelist\n\n`ABBR_TIPS_ALIAS_WHITELIST`\n\nBy default, if the command is a user-defined function (alias), the plugin won't search for a matching abbreviation because your aliases names are likely to be uniques, so there wouldn't be abbreviations with the same names.\n\nBut, in some cases, you may write aliases that wrap existing commands without altering their actual execution (e.g., add some hooks before/after the command execution). In this special case, you may also have abbreviations using these aliases, so you don't want to ignore them.\n\nTo do that, add these aliases to the environment variable.\n\n### Regexes\n\n`ABBR_TIPS_REGEXES`\n\nIf the command doesn't match an abbreviation/alias exactly, it is tested against some regexes to extract a possible abbreviation/alias.\n\nFor example, you could have an abbreviation/alias like this :\n\n```console\ngcm =\u003e git commit -m\n```\n\nSo you want a tip when typing `git commit -m \"my commit\"`, but the command doesn't match exactly `git commit -m`.\nTo tackle this, we have a default regex that will match commands with arguments removed, so your `git commit -m \"my commit\"` will be tested as `git commit -m`.\n\nYou can add such regexes to the `ABBR_TIPS_REGEXES` list, and they will be tested in the order in which they have been added (see [default configuration](#default-configuration)). Matching is lazy, so if the string extracted with the first regex matches an abbreviation/alias, it won't go further. Remember that only the _first matching group_ will be tested. (so you must have at least one per regex)\n\n## 🎥 Behind the scenes\n\nIn order to not slow down your prompt, the plugin store abbreviations/aliases and their corresponding commands in lists (actually simulating a dictionary, as [fish doesn't support dict yet](https://github.com/fish-shell/fish-shell/issues/390)) to avoid iterating over all abbreviations/aliases each time you type a command. So retrieving an abbreviation or an alias from a command is fast as it doesn't involve any loop.\n\nThe plugin will create lists once during installation by calling `__abbr_tips_init` in the background (more precisely in spawned shell, because [fish doesn't put functions in background](https://github.com/fish-shell/fish-shell/issues/238)). Then, lists will get updated when you add or remove abbreviation/alias using `abbr` or `functions` builtin.\n\n## 💭 Inspiration\n\nInspired by [zsh-fast-alias-tips](https://github.com/sei40kr/zsh-fast-alias-tips) and [alias-tips](https://github.com/djui/alias-tips) zsh plugins\n\n## 📝 License\n\n[MIT](https://github.com/Gazorby/fish-abbreviation-tips/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGazorby%2Ffish-abbreviation-tips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGazorby%2Ffish-abbreviation-tips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGazorby%2Ffish-abbreviation-tips/lists"}