Compare commits

...

7 Commits

Author SHA1 Message Date
Henry Bley-Vroman e6c944b06f
Merge 5b1708d3c8 into 85919cd1ff 2025-06-24 13:37:19 -07:00
Eric Freese 85919cd1ff
Merge pull request #829 from win8linux/patch-1
INSTALL.md: Add FreeBSD
2025-06-24 10:15:03 -06:00
Eric Freese dc8dcf7425
Merge pull request #831 from ShoeBoom/patch-1
Update homebrew install link to point to homebrew website.
2025-06-24 10:13:31 -06:00
ShoeBoom da75fc226d
Update homebrew install link to point to homebrew website.
the git file in the homebrew repo does not provide a clear path to install
2025-06-22 20:12:57 -07:00
Julius Enriquez a00927c673
INSTALL.md: Add FreeBSD 2025-06-07 01:04:21 +08:00
Henry Bley-Vroman 5b1708d3c8
docs: autosuggestion widgets can be called directly 2022-12-19 12:09:37 -10:00
Henry Bley-Vroman 8036b61ad1
docs: widgets calling autosuggestion widgets must be ignored (#716) 2022-12-19 12:09:28 -10:00
2 changed files with 16 additions and 4 deletions

View File

@ -17,8 +17,9 @@
| Arch Linux / Manjaro / Antergos / Hyperbola | [zsh-autosuggestions](https://www.archlinux.org/packages/zsh-autosuggestions), [zsh-autosuggestions-git](https://aur.archlinux.org/packages/zsh-autosuggestions-git) |
| NixOS | [zsh-autosuggestions](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/zs/zsh-autosuggestions/package.nix) |
| Void Linux | [zsh-autosuggestions](https://github.com/void-linux/void-packages/blob/master/srcpkgs/zsh-autosuggestions/template) |
| Mac OS | [homebrew](https://github.com/Homebrew/homebrew-core/blob/master/Formula/z/zsh-autosuggestions.rb) |
| Mac OS | [homebrew](https://formulae.brew.sh/formula/zsh-autosuggestions) |
| NetBSD | [pkgsrc](http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/zsh-autosuggestions/README.html) |
| FreeBSD | [pkg](https://cgit.freebsd.org/ports/tree/shells/zsh-autosuggestions) |
## Antigen

View File

@ -72,6 +72,7 @@ Widgets that modify the buffer and are not found in any of these arrays will fet
**Note:** A widget shouldn't belong to more than one of the above arrays.
**Note:** Any widget which calls one of the [autosuggestion widgets](#autosuggestion-widgets) must be added to `ZSH_AUTOSUGGEST_IGNORE_WIDGETS` before creating the new widget's keymap.
### Disabling suggestion for large buffers
@ -101,9 +102,9 @@ Set `ZSH_AUTOSUGGEST_COMPLETION_IGNORE` to a [glob pattern](http://zsh.sourcefor
**Note:** This only affects the `completion` suggestion strategy.
### Key Bindings
### Autosuggestion widgets
This plugin provides a few widgets that you can use with `bindkey`:
This plugin adds a few [zle widgets](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Widgets):
1. `autosuggest-accept`: Accepts the current suggestion.
2. `autosuggest-execute`: Accepts and executes the current suggestion.
@ -113,12 +114,22 @@ This plugin provides a few widgets that you can use with `bindkey`:
6. `autosuggest-enable`: Re-enables suggestions.
7. `autosuggest-toggle`: Toggles between enabled/disabled suggestions.
For example, this would bind <kbd>ctrl</kbd> + <kbd>space</kbd> to accept the current suggestion.
You can bind any of these widgets to a keyboard shortcut with [`bindkey`](https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins). For example, the following command would bind <kbd>ctrl</kbd> + <kbd>space</kbd> to accept the current suggestion.
```sh
bindkey '^ ' autosuggest-accept
```
You can also call any of them directly with `zle`. For example, the following command would accept the current suggestion (for an explanation of `ZSH_AUTOSUGGEST_IGNORE_WIDGETS` see [Widget mapping](#widget-mapping), above).
```sh
my_widget() {
zle autosuggest-accept
}
typeset -ga ZSH_AUTOSUGGEST_IGNORE_WIDGETS
ZSH_AUTOSUGGEST_IGNORE_WIDGETS+=( my_widget )
zle -N my_widget
```
## Troubleshooting