zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.95k stars 1.86k forks source link

compinit vs zsh-autosuggestions #552

Closed blueray453 closed 1 year ago

blueray453 commented 4 years ago

My current .zshrc has compinit

autoload -Uz compinit
compinit

# zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
# zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[sdsa]=* r:|=* l:|=*'
# zstyle :compinstall filename '/home/ismail/zshfiles/compinstall'

zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' menu select=2
eval "$(dircolors -b)"
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' menu select=long
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true

zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'

# not just at the end
# py3[TAB] result in Python3
# cat /var/l[TAB]/syslog result in `/var/l[TSB]/syslog` 
setopt completeinword

I realized that even if I do not use run compinit the file ~/.zcompdump is there.

My question is, do I need these lines in my .zshrc if I use zsh-autosuggestions?

Does zsh-autosuggestions overlap with any feature of builtin zsh completion system?

CorvetteCole commented 2 years ago

I also have this question

ericfreese commented 1 year ago

My question is, do I need these lines in my .zshrc if I use zsh-autosuggestions?

Yeah you will still need these. This plugin doesn't call compinit for you and you have to have called it yourself in order to use the completion strategy