{"id":13497471,"url":"https://github.com/marlonrichert/zsh-autocomplete","last_synced_at":"2026-07-06T13:52:03.750Z","repository":{"id":37356229,"uuid":"258494065","full_name":"marlonrichert/zsh-autocomplete","owner":"marlonrichert","description":"🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.","archived":false,"fork":false,"pushed_at":"2026-02-18T07:58:06.000Z","size":4467,"stargazers_count":6401,"open_issues_count":31,"forks_count":186,"subscribers_count":23,"default_branch":"main","last_synced_at":"2026-02-18T12:39:11.801Z","etag":null,"topics":["asynchronous","autocomplete","autocompletion","completion","non-blocking","typeahead","typeahead-completions","zsh","zsh-autocomplete","zsh-completion","zsh-plugin","zsh-plugins"],"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/marlonrichert.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},"funding":{"github":["marlonrichert"]}},"created_at":"2020-04-24T11:31:17.000Z","updated_at":"2026-02-18T09:53:47.000Z","dependencies_parsed_at":"2024-03-25T15:16:31.813Z","dependency_job_id":"c60fbafb-618b-45db-b27e-ef0f5148a1a1","html_url":"https://github.com/marlonrichert/zsh-autocomplete","commit_stats":{"total_commits":814,"total_committers":16,"mean_commits":50.875,"dds":0.01842751842751844,"last_synced_commit":"762afacbf227ecd173e899d10a28a478b4c84a3f"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/marlonrichert/zsh-autocomplete","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marlonrichert%2Fzsh-autocomplete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marlonrichert%2Fzsh-autocomplete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marlonrichert%2Fzsh-autocomplete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marlonrichert%2Fzsh-autocomplete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marlonrichert","download_url":"https://codeload.github.com/marlonrichert/zsh-autocomplete/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marlonrichert%2Fzsh-autocomplete/sbom","scorecard":{"id":620835,"data":{"date":"2025-08-11","repo":{"name":"github.com/marlonrichert/zsh-autocomplete","commit":"316c588a92e3444e919ca9a341fc8894c82800a2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":10,"reason":"8 commit(s) and 21 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/lock.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/marlonrichert/zsh-autocomplete/lock.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/marlonrichert/zsh-autocomplete/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/marlonrichert/zsh-autocomplete/test.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T05:11:22.576Z","repository_id":37356229,"created_at":"2025-08-21T05:11:22.576Z","updated_at":"2025-08-21T05:11:22.576Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35193679,"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-06T02:00:07.184Z","response_time":106,"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":["asynchronous","autocomplete","autocompletion","completion","non-blocking","typeahead","typeahead-completions","zsh","zsh-autocomplete","zsh-completion","zsh-plugin","zsh-plugins"],"created_at":"2024-07-31T20:00:31.509Z","updated_at":"2026-07-06T13:52:03.709Z","avatar_url":"https://github.com/marlonrichert.png","language":"Shell","funding_links":["https://github.com/sponsors/marlonrichert"],"categories":["Plugins","Shell","zsh","Linux station","终端"],"sub_categories":["ZSH on Windows","📟️ Cli tools","资源传输下载"],"readme":"# Autocomplete for Zsh\nThis plugin for Zsh adds real-time type-ahead autocompletion to your command line, similar to what\nyou find in desktop apps. While you type on the command line, available completions are listed\nautomatically; no need to press any keyboard shortcuts. Press \u003ckbd\u003eTab\u003c/kbd\u003e to insert the top\ncompletion or \u003ckbd\u003e↓\u003c/kbd\u003e to select a different one.\n\nAdditional features:\n* Out-of-the-box configuration of Zsh's completion system\n* Multi-line history search\n* Completion of recent directories\n* Useful [keyboard shortcuts](#keyboard-shortcuts)\n* Easy to [configure](#configuration)\n\n\u003e Enjoy using this software? [Become a sponsor!](https://github.com/sponsors/marlonrichert) 💝\n\n## Requirements\nRecommended:\n* Tested to work with [Zsh](http://zsh.sourceforge.net) 5.8 and newer.\n\nMinimum:\n* Should theoretically work with Zsh 5.4, but I'm unable to test that.\n\n## Installation \u0026 setup\n\u003e Note: In this manual, `%` represents the command line prompt. If you see it in front of a command,\n\u003e it means you should run it on the command line, not put it in a script.\n\nFirst, install Autocomplete itself. Here are some way to do so:\n  * To use only releases (instead of the `main` branch), install `zsh-autocomplete` with a package\n    manager. As of this writing, this package is available through Homebrew, Nix, `pacman`, Plumage,\n    and (as `app-shells/zsh-autocomplete`) Portage.\n  * To always use the latest commit on the `main` branch, do one of the following:\n    * Use `pacman` to install `zsh-autocomplete-git`.\n    * Use a Zsh plugin manager to install `marlonrichert/zsh-autocomplete`. (If you don't have a\n      plugin manager yet, I recommend using [Znap](https://github.com/marlonrichert/zsh-snap).)\n    * Clone the repo directly:\n      ```sh\n      % git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git\n      ```\n\nAfter installing, make the following modifications to your shell config:\n* In your `.zshrc` file:\n  * Remove any calls to `compinit`.\n  * Add near the top, _before_ any calls to `compdef`:\n     ```sh\n     source /path/to/zsh-autocomplete/zsh-autocomplete.plugin.zsh\n     ```\n* When using **Ubuntu,** add to your `.zshenv` file:\n  ```sh\n  skip_global_compinit=1\n  ```\n* When using **Nix,** add to your `home.nix` file:\n  ```\n  programs.zsh.enableCompletion = false;\n  ```\n\nFinally, restart your shell. Here's two ways to do so:\n* Open a new tab or window in your terminal.\n* Replace the current shell with a new one:\n  ```sh\n  % exec zsh\n  ```\n\n### Updating\nIf you installed manually, run:\n```sh\n% git -C ~autocomplete pull\n```\nOtherwise, simply use your package manager or plugin manager's update mechanisms.\n\n### Uninstalling\n 1. Revert the actions you took to [install](#installation).\n 1. Restart your shell.\n\n## Keyboard shortcuts\n| `main` | `emacs` | `vicmd` | On the command line | In the menus\n| ---: | ---: | ---: | :--- | :---\n| \u003ckbd\u003eEnter\u003c/kbd\u003e\u003cbr\u003e\u003ckbd\u003eReturn\u003c/kbd\u003e | | | | Exit menu text search or exit  menu\n| \u003ckbd\u003eTab\u003c/kbd\u003e | | | Insert first listed menu item | Exit menu text search or exit menu\n| \u003ckbd\u003eShift\u003c/kbd\u003e\u003ckbd\u003eTab\u003c/kbd\u003e | | | Insert substring occurring in all listed completions | Exit menu text search or exit menu\n| \u003ckbd\u003e↓\u003c/kbd\u003e | \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eN\u003c/kbd\u003e | \u003ckbd\u003eJ\u003c/kbd\u003e | Cursor down or enter completion menu | Change selection\n| \u003ckbd\u003e↑\u003c/kbd\u003e | \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eP\u003c/kbd\u003e | \u003ckbd\u003eK\u003c/kbd\u003e | Cursor up or enter [history menu](#history-menu) | Change selection\n| \u003ckbd\u003eAlt\u003c/kbd\u003e\u003ckbd\u003e↓\u003c/kbd\u003e | \u003ckbd\u003eAlt\u003c/kbd\u003e\u003ckbd\u003eN\u003c/kbd\u003e | \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eN\u003c/kbd\u003e | Enter completion menu | Next section\n| \u003ckbd\u003eAlt\u003c/kbd\u003e\u003ckbd\u003e↑\u003c/kbd\u003e | \u003ckbd\u003eAlt\u003c/kbd\u003e\u003ckbd\u003eP\u003c/kbd\u003e | \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eP\u003c/kbd\u003e | Enter history menu | Previous section\n| \u003ckbd\u003ePgDn\u003c/kbd\u003e | | | | Page down\n| \u003ckbd\u003ePgUp\u003c/kbd\u003e | | | | Page up\n| | \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eX\u003c/kbd\u003e \u003ckbd\u003e/\u003c/kbd\u003e | | Toggle recent path search |\n| | \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eR\u003c/kbd\u003e | \u003ckbd\u003e/\u003c/kbd\u003e | Toggle history search | Start menu text search or go to previous match\n| | \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eS\u003c/kbd\u003e | \u003ckbd\u003e?\u003c/kbd\u003e | Start menu text search | Start menu text search or go to next match\n| | \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eSpace\u003c/kbd\u003e | \u003ckbd\u003eV\u003c/kbd\u003e | Toggle selection mode | Add another item\n| | \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003e-\u003c/kbd\u003e\u003cbr\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003e/\u003c/kbd\u003e | \u003ckbd\u003eU\u003c/kbd\u003e | | Undo last item\n| | \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eG\u003c/kbd\u003e | | | Undo all added items\n\n### Caveats\n* `main` is whichever keymap was aliased to `main` when Autocomplete was sourced.\n  * By default, this is `emacs`.\n  * If you run `bindkey -v` _before_ sourcing Autocomplete, then `main` will be `viins` when\n     Autocomplete installs keybindings.\n* Plugins or other scripts that you load _after_ loading Autocomplete may override these bindings.\n  If you find that some shortcuts don't work as expected, then you can fix them by\n  * changing the order in which you source your plugins or by\n  * running [`bindkey` commands](#reassign-keys) in your dotfiles _after_ you source your plugins.\n* Depending on your terminal, not all keybindings might be available to you.\n* Instead of \u003ckbd\u003eAlt\u003c/kbd\u003e, your terminal might require you to press \u003ckbd\u003eEscape\u003c/kbd\u003e,\n  \u003ckbd\u003eOption\u003c/kbd\u003e or \u003ckbd\u003eMeta\u003c/kbd\u003e.\n* In the menus, the bindings listed under `vicmd` require you to press \u003ckbd\u003eAlt\u003c/kbd\u003e for each,\n  instead of just once.\n* The bindings listed under `emacs` and `vicmd` are always both active in the menus, no matter which\n  keymap you actually use. This is a limitation of Zsh.\n* What any other keys do while you're in a menu depends on the keymap from which you opened the\n  menu. See the Zsh manual section on [menu\n  selection](https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#Menu-selection) for more info.\n\n## Configuration\nThe following are the most commonly requested ways to configure Autocomplete's behavior. To use any\nof these, add the code shown to your `.zshrc` file and modify it there, then restart you shell.\n\n### Reassign keys\nYou can use [Zsh's `bindkey`\ncommand](https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins), _after_ loading\nAutocomplete, to customize your keybindings. Below are some examples of what you can do with this.\n\n#### Make \u003ckbd\u003eTab\u003c/kbd\u003e and \u003ckbd\u003eShift\u003c/kbd\u003e\u003ckbd\u003eTab\u003c/kbd\u003e cycle completions on the command line\nThis makes \u003ckbd\u003eTab\u003c/kbd\u003e and \u003ckbd\u003eShift\u003c/kbd\u003e\u003ckbd\u003eTab\u003c/kbd\u003e, when pressed on the command line,\ncycle through listed completions, without changing what's listed in the menu:\n```sh\nbindkey              '^I'         menu-complete\nbindkey \"$terminfo[kcbt]\" reverse-menu-complete\n```\n\n#### Make \u003ckbd\u003eTab\u003c/kbd\u003e and \u003ckbd\u003eShift\u003c/kbd\u003e\u003ckbd\u003eTab\u003c/kbd\u003e go to the menu\nThis makes \u003ckbd\u003eTab\u003c/kbd\u003e and \u003ckbd\u003eShift\u003c/kbd\u003e\u003ckbd\u003eTab\u003c/kbd\u003e, when pressed on the command line,\nenter the menu instead of inserting a completion:\n```sh\nbindkey              '^I' menu-select\nbindkey \"$terminfo[kcbt]\" menu-select\n```\n\n#### Make \u003ckbd\u003eTab\u003c/kbd\u003e and \u003ckbd\u003eShift\u003c/kbd\u003e\u003ckbd\u003eTab\u003c/kbd\u003e change the selection in the menu\nThis makes \u003ckbd\u003eTab\u003c/kbd\u003e and \u003ckbd\u003eShift\u003c/kbd\u003e\u003ckbd\u003eTab\u003c/kbd\u003e move the selection in the menu right\nand left, respectively, instead of exiting the menu:\n```sh\nbindkey -M menuselect              '^I'         menu-complete\nbindkey -M menuselect \"$terminfo[kcbt]\" reverse-menu-complete\n```\n\n#### Make \u003ckbd\u003e←\u003c/kbd\u003e and \u003ckbd\u003e→\u003c/kbd\u003e always move the cursor on the command line\nThis makes \u003ckbd\u003e←\u003c/kbd\u003e and \u003ckbd\u003e→\u003c/kbd\u003e always move the cursor on the command line, even when you\nare in the menu:\n```sh\nbindkey -M menuselect  '^[[D' .backward-char  '^[OD' .backward-char\nbindkey -M menuselect  '^[[C'  .forward-char  '^[OC'  .forward-char\n```\n\n#### Make \u003ckbd\u003eEnter\u003c/kbd\u003e always submit the command line\nThis makes \u003ckbd\u003eEnter\u003c/kbd\u003e always submit the command line, even when you are in the menu:\n```sh\nbindkey -M menuselect '^M' .accept-line\n```\n\n#### Restore Zsh-default history shortcuts\nThis restores the default Zsh keybindings for history control:\n```sh\nbindkey -M emacs \\\n    \"^[p\"   .history-search-backward \\\n    \"^[n\"   .history-search-forward \\\n    \"^P\"    .up-line-or-history \\\n    \"^[OA\"  .up-line-or-history \\\n    \"^[[A\"  .up-line-or-history \\\n    \"^N\"    .down-line-or-history \\\n    \"^[OB\"  .down-line-or-history \\\n    \"^[[B\"  .down-line-or-history \\\n    \"^R\"    .history-incremental-search-backward \\\n    \"^S\"    .history-incremental-search-forward \\\n    #\nbindkey -a \\\n    \"^P\"    .up-history \\\n    \"^N\"    .down-history \\\n    \"k\"     .up-line-or-history \\\n    \"^[OA\"  .up-line-or-history \\\n    \"^[[A\"  .up-line-or-history \\\n    \"j\"     .down-line-or-history \\\n    \"^[OB\"  .down-line-or-history \\\n    \"^[[B\"  .down-line-or-history \\\n    \"/\"     .vi-history-search-backward \\\n    \"?\"     .vi-history-search-forward \\\n    #\n```\n\n### Pass arguments to `compinit`\nIf necessary, you can let Autocomplete pass arguments to `compinit` as follows:\n```sh\nzstyle '*:compinit' arguments -D -i -u -C -w\n```\n\n### First insert the common substring\nYou can make any completion widget first insert the longest sequence of characters\nthat will complete to all completions shown, if any, before inserting actual completions:\n```zsh\n# all Tab widgets\nzstyle ':autocomplete:*complete*:*' insert-unambiguous yes\n\n# all history widgets\nzstyle ':autocomplete:*history*:*' insert-unambiguous yes\n\n# ^S\nzstyle ':autocomplete:menu-search:*' insert-unambiguous yes\n```\n\n#### Insert prefix instead of substring\nWhen using the above, if you want each widget to first try to insert only the longest _prefix_ that\nwill complete to all completions shown, if any, then add the following:\n```zsh\nzstyle ':completion:*:*' matcher-list 'm:{[:lower:]-}={[:upper:]_}' '+r:|[.]=**'\n```\nNote, though, that this will also slightly change what completions are listed initially. This is a\nlimitation of the underlying implementation in Zsh.\n\n### Customize common substring message\nYou can customize the way the common substring is presented. The following sets the presentation to\nthe default:\n```zsh\nbuiltin zstyle ':autocomplete:*:unambiguous' format \\\n    $'%{\\e[0;2m%}%Bcommon substring:%b %0F%11K%d%f%k'\n```\n`%d` will be replaced with the common substring. Additionally, the following [Zsh prompt escape\nsequences](https://zsh.sourceforge.io/Doc/Release/Prompt-Expansion.html#Visual-effects) are\nsupported for adding visual effects:\n* `%B`: bold\n* `%F`: foreground color\n* `%K`: background color\n* `%S`: `terminfo` \"standout\"\n* `%U`: underline\n* `%{...%}`: arbitrary [ANSI escape\n   sequence](https://en.wikipedia.org/wiki/ANSI_escape_code#Select_Graphic_Rendition_parameters)\n\n### Make \u003ckbd\u003eEnter\u003c/kbd\u003e submit the command line straight from the menu\nBy default, pressing \u003ckbd\u003eEnter\u003c/kbd\u003e in the menu search exits the search and\npressing it otherwise in the menu exits the menu.  If you instead want to make\n\u003ckbd\u003eEnter\u003c/kbd\u003e _always_ submit the command line, use the following:\n```zsh\nbindkey -M menuselect '\\r' .accept-line\n```\n\n### Add or don't add a space after certain completions\nWhen inserting a completion, a space is added after certain types of\ncompletions.  The default list is as follows:\n```zsh\nzstyle ':autocomplete:*' add-space \\\n    executables aliases functions builtins reserved-words commands\n```\nModifying this list will change when a space is inserted.  If you change the\nlist to `'*'`, a space is always inserted.  If you put no elements in the list,\nthen a space is never inserted.\n\n### Start each command line in history search mode\nThis will make Autocomplete behave as if you pressed \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eR\u003c/kbd\u003e at the start of\neach new command line:\n```zsh\nzstyle ':autocomplete:*' default-context history-incremental-search-backward\n```\n\n### Wait with autocompletion until typing stops for a certain amount of seconds\nNormally, Autocomplete fetches completions after you stop typing for about 0.05 seconds. You can\nchange this as follows:\n```zsh\nzstyle ':autocomplete:*' delay 0.1  # seconds (float)\n```\n\n### Wait longer before timing out autocompletion\nSlow autocompletion can make the command line hang. Therefore, by default, Autocomplete waits at\nmost 1 second for completion to finish. You can change this value as follows:\n```zsh\nzstyle ':autocomplete:*' timeout 2.0  # seconds (float)\n```\nNote, though, that increasing this value can make your command line feel less responsive.\n\n### Wait for a minimum amount of input\nTo suppress autocompletion until a minimum number of characters have been typed:\n```zsh\nzstyle ':autocomplete:*' min-input 3\n```\n\n### Don't show completions if the current word matches a pattern\nFor example, this will stop completions from showing whenever the current word consists of two or\nmore dots:\n```zsh\nzstyle ':autocomplete:*' ignored-input '..##'\n```\n\n## Change the max number of lines shown\nBy default, Autocomplete lets the history menu fill half of the screen, and limits all real-time\nlistings to a maximum of 16 lines. You can change these limits as follows:\n\n```zsh\n# Note: -e lets you specify a dynamically generated value.\n\n# Override default for all listings\n# $LINES is the number of lines that fit on screen.\nzstyle -e ':autocomplete:*:*' list-lines 'reply=( $(( LINES / 3 )) )'\n\n# Override for recent path search only\nzstyle ':autocomplete:recent-paths:*' list-lines 10\n\n# Override for history search only\nzstyle ':autocomplete:history-incremental-search-backward:*' list-lines 8\n\n# Override for history menu only\nzstyle ':autocomplete:history-search-backward:*' list-lines 2000\n```\n\nNote that for all real-time listings, the maximum number of lines is additionally capped to the\nnumber of lines that fit on screen. However, there is no such limit for the history menu. If that\ngenerates more lines than fit on screen, you can simply use \u003ckbd\u003ePgUp\u003c/kbd\u003e and \u003ckbd\u003ePgDn\u003c/kbd\u003e to\nscroll through the excess lines. (Note: On some terminals, you have to additionally hold\n\u003ckbd\u003eShift\u003c/kbd\u003e or, otherwise, it will scroll the terminal buffer instead.)\n\n### Use a custom backend for recent directories\nAutocomplete comes with its own backend for keeping track of and listing recent directories (which\nuses part of\n[`cdr`](https://zsh.sourceforge.io/Doc/Release/User-Contributions.html#Recent-Directories) under the\nhood). However, you can override this and supply Autocomplete with recent directories from any\nsource that you like. To do so, define a function like this:\n\n```sh\n+autocomplete:recent-directories() {\n  \u003ccode\u003e\n  typeset -ga reply=( \u003cany number of absolute paths\u003e )\n}\n```\n\n#### Add a backend for recent files\nOut of the box, Autocomplete doesn't track or offer recent files. However, it will do so if you add\na backend for it:\n\n```sh\n+autocomplete:recent-files() {\n  \u003ccode\u003e\n  typeset -ga reply=( \u003cany number of absolute paths\u003e )\n}\n```\n\n## Troubleshooting\nTry the steps in the\n[bug report template](.github/ISSUE_TEMPLATE/bug-report.md).\n\n## Author \u0026 License\nSee the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarlonrichert%2Fzsh-autocomplete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarlonrichert%2Fzsh-autocomplete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarlonrichert%2Fzsh-autocomplete/lists"}