zsh-autocomplete
adds real-time type-ahead autocompletion to Zsh. Find as you type, then
press Tab to insert the top completion, ShiftTab to insert the
bottom one, or β/PgDn to select another completion.
Besides live autocompletion, zsh-autocomplete
comes with many other useful completion features.
Zsh's completion system is powerful, but hard to configure. So, zsh-autocomplete
does it for you,
while providing a manageable list of settings for changing the defaults.
Press ControlR or ControlS to do an interactive, multi-line, fuzzy history search.
Press β or PgUp to browse the last 16 history items. If the command line is not empty, then it will instead list the 16 most recent fuzzy matches.
Press ControlSpace in the completion menu or the history menu to insert more than one item.
Works out of the box with zero configuration, but also supports zsh-z
, zoxide
, z.lua
,
rupa/z.sh
, autojump
and fasd
.
Key(s) | Action | Widget |
---|---|---|
Tab | Accept top completion | complete-word |
ShiftTab | Accept bottom completion | complete-word |
ControlSpace | Show additional completions | list-expand |
β | Cursor up (if able) or history menu | up-line-or-search |
β | Cursor down (if able) or completion menu | down-line-or-select |
Altβ | Cursor up (always) | up-line |
Altβ | Cursor down (always) | down-line |
PgUp | History menu (always) | history-search |
PgDn | Completion menu (always) | menu-select |
ControlR | Live history search, from newest to oldest | history-incremental-search-backward |
ControlS | Live history search, from oldest to newest | history-incremental-search-forward |
Key(s) | Action |
---|---|
β/β/β/β | Change selection |
Altβ | Backward one group |
Altβ | Forward one group |
PgUp/PgDn | Page up/down |
Home/End | Beginning/End of menu |
ControlSpace | Multi-select |
Tab | Accept selection |
ShiftTab | Reject selection |
Enter | Accept command line |
Key(s) | Action |
---|---|
β/β | Change selection |
Home/End | Beginning/End of menu |
ControlSpace | Multi-select |
β/β | Accept selection & move cursor |
Tab | Accept selection |
ShiftTab | Reject selection |
Enter | Accept command line |
Recommended:
- Zsh 5.8 or later.
Minimum:
- Zsh 5.3 or later.
If you use Znap, simply add the following to your
.zshrc
file:
znap source marlonrichert/zsh-autocomplete
To update, do
% znap pull
- Clone the repo:
% cd ~/Git # or wherever you keep your Git repos/Zsh plugins % git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
- Add to your
~/.zshrc
file, before any calls tocompdef
:source ~/Git/zsh-autocomplete/zsh-autocomplete.plugin.zsh
- Remove any calls to
compinit
from your~/.zshrc
file.
Then, to update, do:
% git -C ~zsh-autocomplete pull
To install with another Zsh framework or plugin manager, please refer to your framework's/plugin manager's documentation for instructions.
See the included .zshrc
file.
Check out the latest development version:
cd ~zsh-autocomplete; git switch main; git pull
Then restart your shell.
If that doesn't help, try deleting completion cache files:
rm -rf $_comp_dumpfile $XDG_CACHE_HOME/zsh
Then restart your shell.
If that fails, try restarting Zsh without global config files:
exec zsh -d
Failing that, try the steps in the bug report template.
Β© 2020 Marlon Richert
This project is licensed under the MIT License. See the LICENSE file for details.