completion.zsh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ## fixme - the load process here seems a bit bizarre
  2. unsetopt menu_complete # do not autoselect the first completion entry
  3. unsetopt flowcontrol
  4. setopt auto_menu # show completion menu on succesive tab press
  5. setopt complete_in_word
  6. setopt always_to_end
  7. WORDCHARS=''
  8. autoload -U compinit
  9. compinit -i
  10. zmodload -i zsh/complist
  11. ## case-insensitive (all),partial-word and then substring completion
  12. if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
  13. zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  14. unset CASE_SENSITIVE
  15. else
  16. zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  17. fi
  18. zstyle ':completion:*' list-colors ''
  19. # should this be in keybindings?
  20. bindkey -M menuselect '^o' accept-and-infer-next-history
  21. zstyle ':completion:*:*:*:*:*' menu select
  22. # zstyle ':completion:*:*:*:*:processes' force-list always
  23. zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
  24. zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
  25. # Load known hosts file for auto-completion with ssh and scp commands
  26. if [ -f ~/.ssh/known_hosts ]; then
  27. zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
  28. zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts`
  29. fi
  30. # Complete on history
  31. #zstyle ':completion:*:history-words' stop yes
  32. #zstyle ':completion:*:history-words' remove-all-dups yes
  33. #zstyle ':completion:*:history-words' list false
  34. #zstyle ':completion:*:history-words' menu yes