{"id":28617616,"url":"https://github.com/seletskiy/zsh-context-aliases","last_synced_at":"2025-10-28T04:10:04.343Z","repository":{"id":141997713,"uuid":"37740300","full_name":"seletskiy/zsh-context-aliases","owner":"seletskiy","description":"Dead simple implementation of context aliases","archived":false,"fork":false,"pushed_at":"2018-12-14T23:29:26.000Z","size":11,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-12T03:51:50.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seletskiy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2015-06-19T18:56:51.000Z","updated_at":"2019-04-13T09:22:46.000Z","dependencies_parsed_at":"2023-07-22T02:41:56.288Z","dependency_job_id":null,"html_url":"https://github.com/seletskiy/zsh-context-aliases","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/seletskiy/zsh-context-aliases","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fzsh-context-aliases","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fzsh-context-aliases/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fzsh-context-aliases/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fzsh-context-aliases/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seletskiy","download_url":"https://codeload.github.com/seletskiy/zsh-context-aliases/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fzsh-context-aliases/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281382867,"owners_count":26491393,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-06-12T03:39:51.728Z","updated_at":"2025-10-28T04:10:04.337Z","avatar_url":"https://github.com/seletskiy.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Stupid as a fish. Mighty as a bear.\n\nWhat is it? It is...\n\n# zsh context aliases\n\nDefine aliases based on context. Context is a shell function which is\nreevaluated each time prompt is drawn.\n\nFor example, you can have alias `s` which is `git status -s` only when you are\ninside git working directory.\n\nOr alias `c` can be `git commit -m`, but if working tree is not dirty, then\n`git commit --amend -m`.\n\n## Installation\n\n### zgen\n\n```zsh\nzgen load seletskiy/zsh-context-aliases\n```\n\n### antigen\n```zsh\nantigen bundle seletskiy/zsh-context-aliases\n```\n\n### Bare-bone usage\n```zsh\ngit clone github.com/seletskiy/zsh-context-aliases ~/.zsh/zsh-context-aliases\n\nfpath+=(~/.zsh/zsh-context-aliases)\nsource ~/.zsh/zsh-context-aliases\n```\n\n## Usage\n\nYou can use all your aliases definitions untouched. Plugin is smart enough to\nunderstand aliases definitions and use them.\n\nWhen you want to define aliases only in specific context, you should use\nfollowing syntax:\n\n```zsh\nalias s=\"default command\"\n\naliases_context some_expression\n    alias s=\"context specific command\"\n```\n\nAlso, it's a good idea to place `aliases_context_init` in the beginning of the\nyour `.zshrc` or aliases file, so if you reload configuration in running shell,\nall context aliases will get properly re-initialized.\n\n## Tips and tricks\n\nLibrary comes with handy helper functions, which can be used to determine\ncontext. They should be autoloaded before use:\n\n```zsh\nautoload is_inside_git_repo\naliases_context is_inside_git_repo\n    alias a='git add'\n    alias s='git status'\n    ...\n```\n\n### `is_inside_git_repo`\n\nExits with 0 status if current directory is a working directory for git repo.\n\n### `is_git_repo_dirty`\n\nExits with 0 if current directory is a dirty working directory.\n\n### `is_rebase_in_progress`\n\nExits with 0 status if rebase in progress.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseletskiy%2Fzsh-context-aliases","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseletskiy%2Fzsh-context-aliases","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseletskiy%2Fzsh-context-aliases/lists"}