Uninstall zsh-autocomplete
mainTo remove the plugin:
- Revert all changes made during the installation process (remove the
sourceline from.zshrc, remove Ubuntu/Nix specific configs, etc.). - Restart your shell.
repository·main·Indexed 27 days ago
https://github.com/marlonrichert/zsh-autocompleteA Zsh plugin providing real-time, type-ahead autocompletion similar to modern desktop applications. It automates the Zsh completion system and enhances navigation through menus and history. The plugin supports multiple keymaps (main, emacs, vicmd) and is highly configurable via zstyle for timing, input requirements, and common substring insertion.
To remove the plugin:
source line from .zshrc, remove Ubuntu/Nix specific configs, etc.).You can customize keybindings by using Zsh's bindkey command after loading Autocomplete. Common customizations include:
# Make <kbd>Tab</kbd> and <kbd>Shift</kbd><kbd>Tab</kbd> cycle completions
bindkey '^I' menu-complete
bindkey "$terminfo[kcbt]" reverse-menu-complete
# Make <kbd>Tab</kbd> and <kbd>Shift</kbd><kbd>Tab</kbd> go to the menu
bindkey '^I' menu-select
bindkey "$terminfo[kcbt]" menu-select
# Make <kbd>Enter</kbd> always submit the command line
bindkey -M menuselect '^M' .accept-lineIf you installed the plugin manually via Git, update it by running:
% git -C ~autocomplete pullIf you used a package manager or a Zsh plugin manager, use their respective update mechanisms.
After installation, you must modify your .zshrc to integrate the plugin correctly:
compinit..zshrc, specifically before any calls to compdef:source /path/to/zsh-autocomplete/zsh-autocomplete.plugin.zsh% exec zshYou can install zsh-autocomplete using a package manager for stable releases, or via Git/Plugin Managers for the latest features.
Available via: Homebrew, Nix, pacman, Plumage, and Portage (as app-shells/zsh-autocomplete).
yay -S zsh-autocomplete-git.marlonrichert/zsh-autocomplete.% git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git% git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.gitDepending on your operating system or shell manager, additional configuration is required to prevent conflicts with the built-in Zsh completion system.
Add this to your .zshenv file:
skip_global_compinit=1Add this to your home.nix file:
programs.zsh.enableCompletion = false;Adjust how Autocomplete triggers to balance responsiveness and performance:
delay: Wait X seconds after typing stops before fetching completions (default is ~0.05s).timeout: Maximum time (in seconds) to wait for completion to finish before timing out (default is 1s).min-input: Minimum number of characters required before autocompletion starts.ignored-input: A pattern that, if matched by the current word, prevents completions from showing.zstyle ':autocomplete:*' delay 0.1
zstyle ':autocomplete:*' timeout 2.0
zstyle ':autocomplete:*' min-input 3
zstyle ':autocomplete:*' ignored-input '..##'Autocomplete allows you to control when spaces and semicolons are automatically inserted during completion.
executables, aliases, functions, builtins, reserved-words, and commands. Set to '*' to always add a space, or an empty list to never add one.Ctrl+Space. Disable this using add-semicolon no.You can override the default limits for how many lines are displayed in completion lists and history menus using zstyle -e (to allow dynamic values like $LINES).
recent-paths, history-incremental-search-backward, or history-search-backward.# Override default for all listings (e.g., 1/3 of screen height)
zstyle -e ':autocomplete:*:*' list-lines 'reply=( $(( LINES / 3 )) )'
# Override for recent path search only
zstyle ':autocomplete:recent-paths:*' list-lines 10
# Override for history search only
zstyle ':autocomplete:history-incremental-search-backward:*' list-lines 8
# Override for history menu only
zstyle ':autocomplete:history-search-backward:*' list-lines 2000You can change how the common substring is displayed using zstyle. The default format uses %d to represent the substring. You can use Zsh prompt escape sequences like %B (bold), %F (foreground color), %K (background color), %S (standout), and %U (underline) to style it.
builtin zstyle ':autocomplete:*:unambiguous' format \
$'%{\e[0;2m%}%Bcommon substring:%b %0F%11K%d%f%k'You can configure Autocomplete to first insert the longest sequence of characters that is common to all completions (the 'unambiguous' substring) before inserting the actual completions.
To enable this for all widgets, history widgets, or menu search, use zstyle ':autocomplete:*:complete*:*' insert-unambiguous yes.
To insert only the longest prefix instead of the full substring, add the following matcher list configuration:
zstyle ':completion:*:*' matcher-list 'm:{[:lower:]-}={[:upper:]_}' '+r:|[.]=**'# all Tab widgets
zstyle ':autocomplete:*complete*:*' insert-unambiguous yes
# all history widgets
zstyle ':autocomplete:*history*:*' insert-unambiguous yes
# ^S
zstyle ':autocomplete:menu-search:*' insert-unambiguous yesIf necessary, you can pass specific arguments to compinit via zstyle to adjust the underlying Zsh completion system behavior.
zstyle '*:compinit' arguments -D -i -u -C -w