completion.zsh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
  23. zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
  24. # Load known hosts file for auto-completion with ssh and scp commands
  25. if [ -f ~/.ssh/known_hosts ]; then
  26. zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
  27. zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts`
  28. fi