[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1605":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":15,"starSnapshotCount":15,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},1605,"zsh-autosuggestions","zsh-users\u002Fzsh-autosuggestions","zsh-users","Fish-like autosuggestions for zsh",null,"Shell",35671,1936,179,161,0,40,210,20,44.86,"MIT License",false,"master",true,[25,26,27,28,29,5],"autocomplete","autosuggest","fish","shell","zsh","2026-06-12 02:00:30","# zsh-autosuggestions\n\n_[Fish](http:\u002F\u002Ffishshell.com\u002F)-like fast\u002Funobtrusive autosuggestions for zsh._\n\nIt suggests commands as you type based on history and completions.\n\nRequirements: Zsh v4.3.11 or later\n\n[![Chat on Gitter](https:\u002F\u002Fimg.shields.io\u002Fgitter\u002Froom\u002Fzsh-users\u002Fzsh-autosuggestions.svg)](https:\u002F\u002Fgitter.im\u002Fzsh-users\u002Fzsh-autosuggestions)\n\n\u003Ca href=\"https:\u002F\u002Fasciinema.org\u002Fa\u002F37390\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fasciinema.org\u002Fa\u002F37390.png\" width=\"400\" \u002F>\u003C\u002Fa>\n\n\n## Installation\n\nSee [INSTALL.md](INSTALL.md).\n\n\n## Usage\n\nAs you type commands, you will see a completion offered after the cursor in a muted gray color. This color can be changed by setting the `ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE` variable. See [configuration](#configuration).\n\nIf you press the \u003Ckbd>→\u003C\u002Fkbd> key (`forward-char` widget) or \u003Ckbd>End\u003C\u002Fkbd> (`end-of-line` widget) with the cursor at the end of the buffer, it will accept the suggestion, replacing the contents of the command line buffer with the suggestion.\n\nIf you invoke the `forward-word` widget, it will partially accept the suggestion up to the point that the cursor moves to.\n\n\n## Configuration\n\nYou may want to override the default global config variables. Default values of these variables can be found [here](src\u002Fconfig.zsh).\n\n**Note:** If you are using Oh My Zsh, you can put this configuration in a file in the `$ZSH_CUSTOM` directory. See their comments on [overriding internals](https:\u002F\u002Fgithub.com\u002Frobbyrussell\u002Foh-my-zsh\u002Fwiki\u002FCustomization#overriding-internals).\n\n\n### Suggestion Highlight Style\n\nSet `ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE` to configure the style that the suggestion is shown with. The default is `fg=8`, which will set the foreground color to color 8 from the [256-color palette](https:\u002F\u002Fupload.wikimedia.org\u002Fwikipedia\u002Fcommons\u002F1\u002F15\u002FXterm_256color_chart.svg). If your terminal only supports 8 colors, you will need to use a number between 0 and 7.\n\nBackground color can also be set, and the suggestion can be styled bold, underlined, or standout. For example, this would show suggestions with bold, underlined, pink text on a cyan background:\n\n```sh\nZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=\"fg=#ff00ff,bg=cyan,bold,underline\"\n```\n\nFor more info, read the Character Highlighting section of the zsh manual: `man zshzle` or [online](http:\u002F\u002Fzsh.sourceforge.net\u002FDoc\u002FRelease\u002FZsh-Line-Editor.html#Character-Highlighting).\n\n**Note:** Some iTerm2 users have reported [not being able to see the suggestions](https:\u002F\u002Fgithub.com\u002Fzsh-users\u002Fzsh-autosuggestions\u002Fissues\u002F416#issuecomment-486516333). If this affects you, the problem is likely caused by incorrect color settings. In order to correct this, go into iTerm2's setting, navigate to profile > colors and make sure that the colors for Basic Colors > Background and ANSI Colors > Bright Black are **different**.\n\n\n### Suggestion Strategy\n\n`ZSH_AUTOSUGGEST_STRATEGY` is an array that specifies how suggestions should be generated. The strategies in the array are tried successively until a suggestion is found. There are currently three built-in strategies to choose from:\n\n- `history`: Chooses the most recent match from history.\n- `completion`: Chooses a suggestion based on what tab-completion would suggest. (requires `zpty` module, which is included with zsh since 4.0.1)\n- `match_prev_cmd`: Like `history`, but chooses the most recent match whose preceding history item matches the most recently executed command ([more info](src\u002Fstrategies\u002Fmatch_prev_cmd.zsh)). Note that this strategy won't work as expected with ZSH options that don't preserve the history order such as `HIST_IGNORE_ALL_DUPS` or `HIST_EXPIRE_DUPS_FIRST`.\n\nFor example, setting `ZSH_AUTOSUGGEST_STRATEGY=(history completion)` will first try to find a suggestion from your history, but, if it can't find a match, will find a suggestion from the completion engine.\n\n\n### Widget Mapping\n\nThis plugin works by triggering custom behavior when certain [zle widgets](http:\u002F\u002Fzsh.sourceforge.net\u002FDoc\u002FRelease\u002FZsh-Line-Editor.html#Zle-Widgets) are invoked. You can add and remove widgets from these arrays to change the behavior of this plugin:\n\n- `ZSH_AUTOSUGGEST_CLEAR_WIDGETS`: Widgets in this array will clear the suggestion when invoked.\n- `ZSH_AUTOSUGGEST_ACCEPT_WIDGETS`: Widgets in this array will accept the suggestion when invoked.\n- `ZSH_AUTOSUGGEST_EXECUTE_WIDGETS`: Widgets in this array will execute the suggestion when invoked.\n- `ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS`: Widgets in this array will partially accept the suggestion when invoked.\n- `ZSH_AUTOSUGGEST_IGNORE_WIDGETS`: Widgets in this array will not trigger any custom behavior.\n\nWidgets that modify the buffer and are not found in any of these arrays will fetch a new suggestion after they are invoked.\n\n**Note:** A widget shouldn't belong to more than one of the above arrays.\n\n\n### Disabling suggestion for large buffers\n\nSet `ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE` to an integer value to disable autosuggestion for large buffers. The default is unset, which means that autosuggestion will be tried for any buffer size. Recommended value is 20.\nThis can be useful when pasting large amount of text in the terminal, to avoid triggering autosuggestion for strings that are too long.\n\n### Asynchronous Mode\n\nSuggestions are fetched asynchronously by default in zsh versions 5.0.8 and greater. To disable asynchronous suggestions and fetch them synchronously instead, `unset ZSH_AUTOSUGGEST_USE_ASYNC` after sourcing the plugin.\n\nAlternatively, if you are using a version of zsh older than 5.0.8 and want to enable asynchronous mode, set the `ZSH_AUTOSUGGEST_USE_ASYNC` variable after sourcing the plugin (it can be set to anything). Note that there is [a bug](https:\u002F\u002Fgithub.com\u002Fzsh-users\u002Fzsh-autosuggestions\u002Fissues\u002F364#issuecomment-481423232) in versions of zsh older than 5.0.8 where \u003Ckbd>ctrl\u003C\u002Fkbd> + \u003Ckbd>c\u003C\u002Fkbd> will fail to reset the prompt immediately after fetching a suggestion asynchronously.\n\n### Disabling automatic widget re-binding\n\nSet `ZSH_AUTOSUGGEST_MANUAL_REBIND` (it can be set to anything) to disable automatic widget re-binding on each precmd. This can be a big boost to performance, but you'll need to handle re-binding yourself if any of the widget lists change or if you or another plugin wrap any of the autosuggest widgets. To re-bind widgets, run `_zsh_autosuggest_bind_widgets`.\n\n### Ignoring history suggestions that match a pattern\n\nSet `ZSH_AUTOSUGGEST_HISTORY_IGNORE` to a [glob pattern](http:\u002F\u002Fzsh.sourceforge.net\u002FDoc\u002FRelease\u002FExpansion.html#Glob-Operators) to prevent offering suggestions for history entries that match the pattern. For example, set it to `\"cd *\"` to never suggest any `cd` commands from history. Or set to `\"?(#c50,)\"` to never suggest anything 50 characters or longer.\n\n**Note:** This only affects the `history` and `match_prev_cmd` suggestion strategies.\n\n### Skipping completion suggestions for certain cases\n\nSet `ZSH_AUTOSUGGEST_COMPLETION_IGNORE` to a [glob pattern](http:\u002F\u002Fzsh.sourceforge.net\u002FDoc\u002FRelease\u002FExpansion.html#Glob-Operators) to prevent offering completion suggestions when the buffer matches that pattern. For example, set it to `\"git *\"` to disable completion suggestions for git subcommands.\n\n**Note:** This only affects the `completion` suggestion strategy.\n\n\n### Key Bindings\n\nThis plugin provides a few widgets that you can use with `bindkey`:\n\n1. `autosuggest-accept`: Accepts the current suggestion.\n2. `autosuggest-execute`: Accepts and executes the current suggestion.\n3. `autosuggest-clear`: Clears the current suggestion.\n4. `autosuggest-fetch`: Fetches a suggestion (works even when suggestions are disabled).\n5. `autosuggest-disable`: Disables suggestions.\n6. `autosuggest-enable`: Re-enables suggestions.\n7. `autosuggest-toggle`: Toggles between enabled\u002Fdisabled suggestions.\n\nFor example, this would bind \u003Ckbd>ctrl\u003C\u002Fkbd> + \u003Ckbd>space\u003C\u002Fkbd> to accept the current suggestion.\n\n```sh\nbindkey '^ ' autosuggest-accept\n```\n\n\n## Troubleshooting\n\nIf you have a problem, please search through [the list of issues on GitHub](https:\u002F\u002Fgithub.com\u002Fzsh-users\u002Fzsh-autosuggestions\u002Fissues?q=) to see if someone else has already reported it.\n\n### Reporting an Issue\n\nBefore reporting an issue, please try temporarily disabling sections of your configuration and other plugins that may be conflicting with this plugin to isolate the problem.\n\nWhen reporting an issue, please include:\n\n- The smallest, simplest `.zshrc` configuration that will reproduce the problem. See [this comment](https:\u002F\u002Fgithub.com\u002Fzsh-users\u002Fzsh-autosuggestions\u002Fissues\u002F102#issuecomment-180944764) for a good example of what this means.\n- The version of zsh you're using (`zsh --version`)\n- Which operating system you're running\n\n\n## Uninstallation\n\n1. Remove the code referencing this plugin from `~\u002F.zshrc`.\n\n2. Remove the git repository from your hard drive\n\n    ```sh\n    rm -rf ~\u002F.zsh\u002Fzsh-autosuggestions # Or wherever you installed\n    ```\n\n\n## Development\n\n### Build Process\n\nEdit the source files in `src\u002F`. Run `make` to build `zsh-autosuggestions.zsh` from those source files.\n\n\n### Pull Requests\n\nPull requests are welcome! If you send a pull request, please:\n\n- Request to merge into the `develop` branch (*NOT* `master`)\n- Match the existing coding conventions.\n- Include helpful comments to keep the barrier-to-entry low for people new to the project.\n- Write tests that cover your code as much as possible.\n\n\n### Testing\n\nTests are written in ruby using the [`rspec`](http:\u002F\u002Frspec.info\u002F) framework. They use [`tmux`](https:\u002F\u002Ftmux.github.io\u002F) to drive a pseudoterminal, sending simulated keystrokes and making assertions on the terminal content.\n\nTest files live in `spec\u002F`. To run the tests, run `make test`. To run a specific test, run `TESTS=spec\u002Fsome_spec.rb make test`. You can also specify a `zsh` binary to use by setting the `TEST_ZSH_BIN` environment variable (ex: `TEST_ZSH_BIN=\u002Fbin\u002Fzsh make test`).\n\nIt's possible to run the tests for any supported version of zsh in a Docker image by building an image from the provided Dockerfile. To build the docker image for a specific version of zsh (where `\u003Cversion>` below is substituted with the contents of a line from the [`ZSH_VERSIONS`](ZSH_VERSIONS) file), run:\n\n```sh\ndocker build --build-arg TEST_ZSH_VERSION=\u003Cversion> -t zsh-autosuggestions-test .\n```\n\nAfter building the image, run the tests via:\n\n```sh\ndocker run -it -v $PWD:\u002Fzsh-autosuggestions zsh-autosuggestions-test make test\n```\n\n\n## License\n\nThis project is licensed under [MIT license](http:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT).\nFor the full text of the license, see the [LICENSE](LICENSE) file.\n","zsh-autosuggestions 是一个为 zsh 提供类似 Fish shell 自动建议功能的插件。它基于用户的历史命令和补全信息，在输入时即时给出建议，提高命令行操作效率。支持自定义建议高亮样式、接受建议的方式以及生成建议的策略等配置选项，使得用户可以根据个人偏好调整显示效果与行为逻辑。适用于需要频繁使用命令行且希望提升输入准确性和速度的开发者或系统管理员。",2,"2026-06-11 02:44:58","top_all"]