{"id":51535163,"url":"https://github.com/testy-cool/zsh-predictive-list","last_synced_at":"2026-07-09T07:30:48.152Z","repository":{"id":361422413,"uuid":"1209634282","full_name":"testy-cool/zsh-predictive-list","owner":"testy-cool","description":"PSReadLine-style prediction list for zsh — success-only history, prefix/substring matching, no ghost text","archived":false,"fork":false,"pushed_at":"2026-05-30T14:38:30.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-30T16:13:41.396Z","etag":null,"topics":["history","predictions","shell","zsh","zsh-plugin"],"latest_commit_sha":null,"homepage":null,"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/testy-cool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-13T16:15:48.000Z","updated_at":"2026-05-30T14:38:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/testy-cool/zsh-predictive-list","commit_stats":null,"previous_names":["testy-cool/zsh-predictive-list"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/testy-cool/zsh-predictive-list","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testy-cool%2Fzsh-predictive-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testy-cool%2Fzsh-predictive-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testy-cool%2Fzsh-predictive-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testy-cool%2Fzsh-predictive-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testy-cool","download_url":"https://codeload.github.com/testy-cool/zsh-predictive-list/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testy-cool%2Fzsh-predictive-list/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35291639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"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":["history","predictions","shell","zsh","zsh-plugin"],"created_at":"2026-07-09T07:30:48.088Z","updated_at":"2026-07-09T07:30:48.145Z","avatar_url":"https://github.com/testy-cool.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zsh-predictive-list\n\nPSReadLine-style **ListView** prediction for zsh. Predictions come **only from commands that exited 0** — typos and failures stay in raw history but never pollute your suggestions.\n\nInspired by [PSReadLine](https://github.com/PowerShell/PSReadLine)'s `ListView` prediction mode for PowerShell.\n\n## What it does\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"preview.svg\" alt=\"zsh-predictive-list preview\" width=\"720\"\u003e\n\u003c/p\u003e\n\n- **No ghost text** — clean list below the prompt, not mixed into your input\n- **Header line** — shows `\u003c-/N\u003e` (no selection) or `\u003cK/N\u003e` (selected), with source count\n- **Source tags** — each item shows `[History]` right-aligned\n- **Success-only** — only commands that exited 0 feed predictions\n- **Buffer updates on navigation** — ↓ selects an item and puts it in your buffer, ↑ restores your typed text\n\n## Install\n\n### zinit\n```zsh\nzinit light testycool/zsh-predictive-list\n```\n\n### oh-my-zsh\n```zsh\ngit clone https://github.com/testycool/zsh-predictive-list ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-predictive-list\n# Add to plugins=(...) in .zshrc\n```\n\n### Manual\n```zsh\nsource /path/to/zsh-predictive-list.plugin.zsh\n```\n\n## Keybindings\n\n| Key | Action |\n|-----|--------|\n| Type anything | List updates automatically |\n| `Down` | Enter list / select next item (buffer updates to match) |\n| `Up` | Select previous item / deselect (restores typed text) |\n| `Right` | Accept top prediction (or selected) when cursor is at end of line |\n| `Tab` | Accept current selection (only while navigating); otherwise normal completion |\n| `Enter` | Execute current buffer |\n| `Ctrl+G` | Dismiss list, restore typed text |\n| `Alt+P` | Toggle predictions on/off |\n\nAdditional widgets (not bound by default — bind them yourself if needed):\n\n| Widget | Action |\n|--------|--------|\n| `zpred-delete-entry` | Remove the selected entry from prediction history |\n\nWhen no predictions match, `Up`/`Down`/`Right` fall back to their normal behavior.\n\n## Configuration\n\nSet these before sourcing the plugin:\n\n```zsh\n# History file location (default: ~/.local/share/zsh-predictive-list/success_history)\nZPRED_HISTORY=\"$HOME/.zsh_success_history\"\n\n# Max visible predictions (default: 6)\nZPRED_MAX_SHOW=8\n\n# Max entries kept in memory and on disk (default: 5000)\nZPRED_MAX_HISTORY=5000\n\n# Match mode: \"prefix\" (default) or \"contains\" (substring matching, prefix results shown first)\nZPRED_MATCH_MODE=\"contains\"\n\n# Styles (zsh region_highlight format)\nZPRED_STYLE_EMPHASIS=\"fg=yellow\"      # matched prefix in unselected items\nZPRED_STYLE_SELECTED=\"standout\"       # selected item (reverse video)\nZPRED_STYLE_DIM=\"fg=8\"               # header, markers, source tags\n```\n\n## Importing existing history\n\nNew installs start with an empty prediction list. Import from your existing zsh history:\n\n```zsh\nzpred-import              # imports from $HISTFILE (handles both plain and EXTENDED_HISTORY format)\nzpred-import /path/to/file  # import from a specific file\n```\n\nSince exit codes aren't stored in `$HISTFILE`, all entries are imported. The prediction list will self-correct over time as successful commands get recorded.\n\n## How it works\n\n1. `preexec` captures each command before execution\n2. `precmd` checks `$?` — if 0, the command is appended to the success history file\n3. `zle-line-pre-redraw` detects buffer changes and updates the prediction list\n4. Matching runs against the deduplicated, most-recent-first success history (prefix or substring)\n5. List renders via `POSTDISPLAY` + `region_highlight` (no ghost text)\n6. Navigation with ↓ updates BUFFER to the selected command; ↑ at top restores typed text\n7. Ctrl+G dismisses the list; typing again un-dismisses it\n8. History file auto-truncates when it exceeds 2× `ZPRED_MAX_HISTORY`\n\n## How it differs from other plugins\n\n| | zsh-predictive-list | zsh-autosuggestions | zsh-autocomplete |\n|---|---|---|---|\n| Display | List below prompt | Inline ghost text | Completion menu |\n| Source | Success history only | Full history + completion | Completion system |\n| Navigation | ↑/↓ through list | → to accept | Tab cycling |\n| Buffer | Updates on selection | Unchanged until accept | Unchanged until accept |\n\n## Requirements\n\n- zsh \u003e= 5.4 (for `zle-line-pre-redraw`)\n\n## Compatibility\n\n- Chains with existing `zle-line-init`, `zle-line-pre-redraw`, and `zle-line-finish` hooks\n- **Conflicts with zsh-autosuggestions** — both use `POSTDISPLAY`. Use one or the other.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftesty-cool%2Fzsh-predictive-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftesty-cool%2Fzsh-predictive-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftesty-cool%2Fzsh-predictive-list/lists"}