{"id":20107172,"url":"https://github.com/felixoid/zsh-hoco","last_synced_at":"2025-05-06T09:32:28.398Z","repository":{"id":39601531,"uuid":"386706721","full_name":"Felixoid/zsh-hoco","owner":"Felixoid","description":"ZSH _hosts autocompletion extension","archived":false,"fork":false,"pushed_at":"2022-06-27T21:12:31.000Z","size":25,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T19:26:28.301Z","etag":null,"topics":["autocomplete","hosts","zsh","zsh-completion","zsh-completions"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Felixoid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-16T16:52:53.000Z","updated_at":"2023-12-01T07:28:33.000Z","dependencies_parsed_at":"2022-08-29T09:11:44.336Z","dependency_job_id":null,"html_url":"https://github.com/Felixoid/zsh-hoco","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felixoid%2Fzsh-hoco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felixoid%2Fzsh-hoco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felixoid%2Fzsh-hoco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felixoid%2Fzsh-hoco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Felixoid","download_url":"https://codeload.github.com/Felixoid/zsh-hoco/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224500002,"owners_count":17321605,"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":["autocomplete","hosts","zsh","zsh-completion","zsh-completions"],"created_at":"2024-11-13T17:56:00.060Z","updated_at":"2024-11-13T17:56:00.177Z","avatar_url":"https://github.com/Felixoid.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Great curassow, image designed by rawpixel.com / Freepik](./docs/hoco.png)\n\n# HOCO - zsh hosts completion\nSmall function to improve and extend original zsh `_hosts` completion function.\n\n## Objectives\nThe original zsh hosts completion is not extendable. And when you replace it with `zstyle -e ':completion:*:hosts' hosts 'reply=(...)'`, all original completions should be represented too.\n\nOn the other hand, `_hosts` caches all hosts for autocompletion only once, and then uses it. And it's not so obvious how to reset it.\n\n## Solution\nThe [hoco.zsh](./hoco.zsh) solves both `_hosts` flaws:\n\n- It updates the cache once per `$HOCO_CACHE_AGE` period, the default is 10 minutes\n- It allows to update list of hosts dynamically. Each binary or function in `$HOCO_FUNCTIONS` array is executed asynchronously. The list of hosts for completion is updated on readiness.\n\n### Usage\n\nThe only thing you need to do is:\n\n```\nsource hoco.zsh\nsome-function() {\n  echo host1 host2 # it does not matter if hosts are separated by spaces\n  echo host3\thost4 # or by new lines (LF), or by tabs\n}\nHOCO_FUNCTIONS=(some-function)\n\nssh \u003ctab\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixoid%2Fzsh-hoco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixoid%2Fzsh-hoco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixoid%2Fzsh-hoco/lists"}