completion.zsh 915 B

123456789101112131415161718192021222324252627282930
  1. setopt noautomenu
  2. setopt COMPLETE_IN_WORD
  3. setopt ALWAYS_TO_END
  4. unsetopt flowcontrol
  5. WORDCHARS=''
  6. autoload -U compinit
  7. compinit
  8. zmodload -i zsh/complist
  9. ## case-insensitive (all),partial-word and then substring completion
  10. zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  11. zstyle ':completion:*' list-colors ''
  12. zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
  13. unsetopt MENU_COMPLETE
  14. setopt AUTO_MENU
  15. bindkey -M menuselect '^o' accept-and-infer-next-history
  16. zstyle ':completion:*:*:*:*:*' menu yes select
  17. # zstyle ':completion:*:*:*:*:processes' force-list always
  18. zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
  19. zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
  20. zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts`