completion.zsh 1.5 KB

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