Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable autosuggestion when having autocompletion selected? #816

Open
beyond-fu opened this issue Dec 10, 2024 · 0 comments
Open

Comments

@beyond-fu
Copy link

I'm using zsh-autosuggestion and zsh-autocompletion. I just installed the latest zsh-autosuggestion and zsh-autocompletion on Fedora41. When I select a completion candidate item, the suggusetion is still there and this is annoying. So I want to know how to make suggestion not showing when one of the completions is selected.

Before enter Tab to complete:
Screenshot From 2024-12-11 01-30-40
After completion:
Screenshot From 2024-12-11 01-30-56

Below is my .zshrc configuration:

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

HISTFILE=~/.zsh_histfile
HISTSIZE=1000
SAVEHIST=2000
bindkey -v    
setopt autocd extendedglob nomatch
unsetopt beep notify

# Snap: zsh plugins manager
[[ -r ~/zsh_plugins/znap/znap.zsh ]] ||
    git clone --depth 1 -- \
        https://github.com/marlonrichert/zsh-snap.git ~/zsh_plugins/znap
source ~/zsh_plugins/znap/znap.zsh  # Start Znap

znap source marlonrichert/zsh-autocomplete
znap source zsh-users/zsh-autosuggestions
znap source zsh-users/zsh-syntax-highlighting

source ~/zsh_plugins/powerlevel10k/powerlevel10k.zsh-theme
. "$HOME/.cargo/env"

bindkey "^[[1;5C" "forward-word"
bindkey "^[[1;5D" "backward-word"
bindkey              '^I' menu-select
bindkey "$terminfo[kcbt]" menu-select
bindkey -M menuselect              '^I'         menu-complete
bindkey -M menuselect "$terminfo[kcbt]" reverse-menu-complete
bindkey  "^[[H"   beginning-of-line
bindkey  "^[[F"   end-of-line
bindkey  "^[[3~"  delete-char

zstyle ':autocomplete:*complete*:*' insert-unambiguous yes
zstyle ':autocomplete:*history*:*' insert-unambiguous yes
zstyle ':completion:*:*' matcher-list 'm:{[:lower:]-}={[:upper:]_}' '+r:|[.]=**'

zstyle -e ':autocomplete:*:*' list-lines 'reply=( $(( LINES / 2 )) )'
zstyle ':completion:*:messages' format $'\e[01;35m -- %d -- \e[00;00m'
zstyle ':completion:*:warnings' format $'\e[01;31m -- No Matches Found -- \e[00;00m'
zstyle ':autocomplete:*' ignored-input '..##'

[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant